【问题标题】:NotificationListenerService in Android MarshmallowAndroid Marshmallow 中的 NotificationListenerService
【发布时间】:2017-05-17 10:32:38
【问题描述】:

当用户从应用程序中注销时,我需要清除我的应用程序通知。我没有使用 NotificationBuilder 生成通知,我的通知是直接从应用程序的服务器生成的。我能够清除我在 android lolipop 及以下用户注销时的通知。 但是对于棉花糖,当用户从设置中授予通知访问权限时,我没有收到任何棉花糖通知。需要一些帮助。 我正在接收来自 Firebase 的通知。

【问题讨论】:

    标签: android firebase notifications logout firebase-notifications


    【解决方案1】:

    您需要做的就是:

    ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancelAll();
    

    不需要通知访问和所有其他逻辑。

    【讨论】:

      猜你喜欢
      • 2021-06-13
      • 2013-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多