本文介绍了取消通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Onesignal推送通知,并且需要取消onPause和onResume的所有通知,
I use Onesignal to push notification and need to cancel all notification of onPause and onResume,
NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE); if (notificationManager!=null) notificationManager.cancelAll();,但无法正常工作.应用重新启动时,我会收到所有旧通知.我对我的应用进行了调整,这些旧通知无需显示. 请帮忙解决这个问题!
but it's not work correctly. When app restarted I get all old notifications. I restard my app and these old notifications need to not showing. Please help to fix this!!
推荐答案您需要使用OneSignal SDK clearOneSignalNotifications
You need to use this method from OneSignal SDK clearOneSignalNotifications
或仅一个通知cancelNotification.
在此处检查
更多推荐
取消通知
发布评论