代码之家  ›  专栏  ›  技术社区  ›  masiboo

如何处理来自系统托盘的Android推送消息?

  •  0
  • masiboo  · 技术社区  · 6 年前

    在我的应用程序中,我收到来自Azure通知中心的推送消息。当我的应用程序在后台时,推送消息会进入系统托盘。

    当用户单击推送消息时,它会将应用程序带到前台。我想将用户重定向到我的应用程序的特定活动。我不知道怎么做。有可能吗?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Sunil Sunny    6 年前

    当应用程序在后台时,数据将作为一个额外的包发送。您可以在启动活动或启动屏幕中这样处理它。

      Bundle bundle = getIntent().getExtras();
        if (bundle != null) {
              Check the data and redirect to the required activity from here.
        }