Phonegap 多推送通知,当打开一个并返回时,它会从托盘中删除我的所有通知 - Android

Phonegap Multiple Push notification,when open one and go back it deletes all my notification from Tray - Android

我收到所有推送通知,点击其中一个通知后,我可以在 tray.But 中看到该应用程序已打开,而其他通知则保留在栏上但是当您按下主页按钮时,该应用程序会进入背景和托盘也清除所有通知。但我希望通知完好无损

清除:
1- 应用程序在后台
2- 发送多个通知
3- 您可以看到所有通知
4- 单击其中一个主题并打开应用程序
5- 其他通知在应用程序打开时留在栏中
6- 当您按下后退按钮或主页按钮时,所有通知都已删除

我正在使用 https://github.com/phonegap-build/PushPlugin

您的问题将通过删除按下主页按钮后取消通知的两行来解决:

final NotificationManager notificationManager = (NotificationManager) cordova.getActivity().getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancelAll();

这两行是在PushPlugin.java文件的onPause()方法中找到的。