简体   繁体   中英

Firebase Push notification is not Received when i kill the app?

  1. FCM Notification is working fine when the app is foreground & background

  2. Notification is not working when we kill the app?

My payload:

notification" : {
      "body" : "great match!",
      "title" : "Portugal vs. Denmark",
      }
"data" : {
     "Nick" : "Mario",
     "body" : "great match!",
   }

You always receive PUSH Notifications through FCM. But how notifications are received is different in both cases ie when app is in background and foreground. You have to check for it. Killing App will not effect it unless you stop service. If service is stopped, you won't receive notifications.

Second, if you are overriding onDataChange() and want to show notification whenever data changes then know that this function only executes when app is in foreground or not killed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM