Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果应用程序正在前台运行,则不会调用Android推送事件处理程序_Android_Cordova_Push Notification_Cordova Plugins_Phonegap Pushplugin - Fatal编程技术网

如果应用程序正在前台运行,则不会调用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通知?