on('notification')在前台运行时未触发

问题描述 投票:0回答:1

这里问了同样的问题:https://forum.ionicframework.com/t/on-notification-not-fired-when-app-in-foreground/171687但是我没有答案,我无法弄清楚这个答案。

我正在Ionic 3移动应用程序中使用phonegap-plugin-push插件。

[在后台运行的应用收到推送后,通知会显示在我的iPhone的通知中心中。单击它会打开应用程序,并运行push.on(“ notification”)处理程序代码。

[当应用在前台运行时,push.on('notification')处理程序代码未运行。我在xcode日志中看到的唯一东西是带有fetchCompletionHandler的didReceiveNotification

有没有人看过同一件事,并且知道以任何方式使on('notification')代码也可以在前台运行?

它在Android上正常运行,但在iOS上不运行

谢谢,拉斯

ionic3 cordova-plugins phonegap-plugin-push
1个回答
0
投票

删除您的推送插件,然后使用@ 2.2.3重新安装。我希望这对您有用。

© www.soinside.com 2019 - 2024. All rights reserved.