Firebase onMessageReceived not called when app in background

前端 未结 26 2701
粉色の甜心
粉色の甜心 2020-11-22 02:32

I\'m working with Firebase and testing sending notifications to my app from my server while the app is in the background. The notification is sent successfully, it even appe

26条回答
  •  后悔当初
    2020-11-22 03:22

    this method handleIntent() has been depreciated, so handling a notification can be done as below:

    1. Foreground State: The click of the notification will go to the pending Intent's activity which you are providing while creating a notification pro-grammatically as it generally created with data payload of the notification.

    2. Background/Killed State - Here, the system itself creates a notification based on notification payload and clicking on that notification will take you to the launcher activity of the application where you can easily fetch Intent data in any of your life-cycle methods.

提交回复
热议问题