[英]Empty notification with phonegap-plugin-push
I'm using push notifications in my ionic+phonegap-plugin-push app without problem.我在 ionic+phonegap-plugin-push 应用程序中使用推送通知没有问题。
Everything works fine BUT, once a day or so I get a blank notification, no message, nothing but the app icon and there is no way you can remove that notification from the "notification center".一切正常,但是,每天一次左右,我收到一条空白通知,没有消息,只有应用程序图标,而且您无法从“通知中心”中删除该通知。
It seems to happen only in android so I guess is related to the push plugin or maybe something related to the new firebase back, ionic, ...no idea seriously.它似乎只发生在 android 中,所以我想这与 push 插件有关,或者可能与新的 firebase back、ionic、...无关。
Any ideas?有任何想法吗? According to the logs in the server the payloads are the right ones and I'm not able to reproduce it.
根据服务器中的日志,有效负载是正确的,我无法重现它。
I'm using:我正在使用:
I thought it was a problem with the phonegap push plugin but it was not.我认为这是 phonegap push 插件的问题,但事实并非如此。
I was also using the cordova-plugin-background-mode which internally creates a local notification to wake up the app in the background.我还使用了cordova-plugin-background-mode ,它在内部创建了一个本地通知来在后台唤醒应用程序。
My code configures the plugin with silent mode so it is supposed to create a local notification that doesnt show up anywhere.我的代码将插件配置为静默模式,因此它应该创建一个不会出现在任何地方的本地通知。
$ionicPlatform.ready(function () {
cordova.plugins.backgroundMode.setDefaults({ silent: true });
cordova.plugins.backgroundMode.enable();
cordova.plugins.backgroundMode.onactivate = function () {
//my own stuff here...
};
});
There is a closed issue that reflects this ( https://github.com/katzer/cordova-plugin-background-mode/issues/89 ) and according to some comments and my own experience it is still happening.有一个已解决的问题反映了这一点( https://github.com/katzer/cordova-plugin-background-mode/issues/89 ),根据一些评论和我自己的经验,它仍在发生。
Hope it helps.希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.