【问题标题】:Get status between user click and user delete/remove in NotificationListenerService在 NotificationListenerService 中获取用户单击和用户删除/删除之间的状态
【发布时间】:2018-02-22 07:38:17
【问题描述】:

现在,我的应用收到来自 Firebase通知,我使用 NotificationListenerService 在收到时获取事件并删除/删除通知。它工作正常。

但在 onNotificationRemoved 中,我想通过 用户单击打开删除 了解通知关闭的状态。我该怎么办??

请帮帮我。

这是我的代码

【问题讨论】:

    标签: android push-notification notifications android-notifications android-notification-bar


    【解决方案1】:

    在 notificationCompat 构建器的帮助下发布通知时,您可以在其中设置“DeleteIntent”,您可以使用广播接收器设置 PendingIntent,以便在用户删除或刷出您的通知时获取广播。

    【讨论】:

    • 我没有在我的应用程序中搜索发布通知方法,因为它是从 firebase 发送的,并在 php 文件正文中设置了所有内容,例如标题等。我可以在哪里使用 notificationCompat 构建器?
    猜你喜欢
    • 2023-01-05
    • 1970-01-01
    • 1970-01-01
    • 2014-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-01
    相关资源
    最近更新 更多