Ios Cordova PushPlugin不';重新启动后,点火通知APN
我有一个应用程序设置(Phonegap),它使用PushPlugin进行通知,除了重新启动应用程序外,一切正常。onNotificationAPN在安装并运行应用程序时工作,在应用程序处于后台时也可以正常工作(即所有通知都可以工作) 问题发生在我重新启动应用程序时,如果我重新启动应用程序,“onNotificationAPN”似乎不再被调用,尽管仍会收到通知并且控制台输出“notification received”,如果在后台运行应用程序,则会收到通知横幅。如果不调用“onNotificationAPN”,当用户打开应用程序时,我无法在前台显示通知 现在我正在使用PushPlugin源代码提供的标准示例函数:Ios Cordova PushPlugin不';重新启动后,点火通知APN,ios,cordova,notifications,Ios,Cordova,Notifications,我有一个应用程序设置(Phonegap),它使用PushPlugin进行通知,除了重新启动应用程序外,一切正常。onNotificationAPN在安装并运行应用程序时工作,在应用程序处于后台时也可以正常工作(即所有通知都可以工作) 问题发生在我重新启动应用程序时,如果我重新启动应用程序,“onNotificationAPN”似乎不再被调用,尽管仍会收到通知并且控制台输出“notification received”,如果在后台运行应用程序,则会收到通知横幅。如果不调用“onNotificati
function onNotificationAPN(e) {
if (e.alert) {
$("#app-status-ul").append('<li>push-notification: ' + e.alert + '</li>');
// showing an alert also requires the org.apache.cordova.dialogs plugin
navigator.notification.alert(e.alert);
}
if (e.sound) {
// playing a sound also requires the org.apache.cordova.media plugin
var snd = new Media(e.sound);
snd.play();
}
if (e.badge) {
pushNotification.setApplicationIconBadgeNumber(successHandler, e.badge);
}
}
通知APN(e)上的函数{
如果(如警报){
$(“#应用程序状态ul”).append(“