取消通知

编程入门 行业动态 更新时间:2024-10-20 06:21:50
本文介绍了取消通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用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.

在此处检查

更多推荐

取消通知

本文发布于:2023-11-27 09:13:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637453.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:通知

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!