如果应用程序正在前台运行,则不会调用Android推送事件处理程序
我正在使用推送通知如果应用程序正在前台运行,则不会调用Android推送事件处理程序,android,cordova,push-notification,cordova-plugins,phonegap-pushplugin,Android,Cordova,Push Notification,Cordova Plugins,Phonegap Pushplugin,我正在使用推送通知 pushRegistry = window.PushNotification.init({ android: { 'senderID': 'appId' }, ios: { alert: 'true', badge: 'false', sound: 'true' } }); pushRegistry.on('not
pushRegistry = window.PushNotification.init({
android: {
'senderID': 'appId'
},
ios: {
alert: 'true',
badge: 'false',
sound: 'true'
}
});
pushRegistry.on('notification', function(data){
console.log(data);
});
现在,当收到通知并关闭应用程序时,将调用上面的事件处理程序。但如果应用程序正在运行,则不会调用它。我正在使用Chrome设备调试器检查是否调用了事件处理程序。我将非常感谢在这方面的任何帮助 你真的是指上面的
console.log(data)
,还是实际上是指toast通知?