简体   繁体   English

我杀死应用程序后未收到Firebase推送通知?

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

  1. FCM Notification is working fine when the app is foreground & background 当应用程序为前台和后台时,FCM通知工作正常

  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. 您总是通过FCM收到PUSH通知。 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. 其次,如果您要覆盖onDataChange()并想在数据更改时显示通知,则知道此函数仅在应用程序处于前台或未onDataChange()时才执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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