【问题标题】:how to know that an app was launch from a click to a notification in the system tray?如何知道应用程序是从点击系统托盘中的通知启动的?
【发布时间】:2022-12-21 17:35:54
【问题描述】:

当我发送警报通知时,如果该应用程序未运行或处于后台,警报将在系统托盘中终止。稍后用户单击此通知并启动应用程序。我如何知道应用程序是通过单击系统托盘中的通知警报启动的?我如何检索有关此通知的信息?此外,并不是说我正在使用 Firebase 云消息传递。

【问题讨论】:

  • 您可以在启动启动活动的 Intent 中放置一个 Bundle Extra。如果 Intent 有这个 Extra,则表示 App 是从 Notification 启动的
  • @MayorJay 但是如何额外添加这个 Bundle 呢?我从 google firebase messaging 发送了消息

标签: android firebase android-intent firebase-cloud-messaging android-notifications


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多