Firebase onMessageReceived not called when app in background

前端 未结 26 3337
粉色の甜心
粉色の甜心 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:07

    By default the Launcher Activity in you app will be launched when your app is in background and you click the notification, if you have any data part with your notifcation you can handle it in the same activity as follows,

    if(getIntent().getExtras()! = null){
      //do your stuff
    }else{
      //do that you normally do
    }
    

提交回复
热议问题