1

Push message is received well when app in background or foreground state. When app is killed push never comes.

Push data:

{
 "to" : "e3UQwRr.....,
 "click_action" : "asd",
 "priority":"high",
 "data" : {
     "body" : "First Notification1",
     "title": "Collapsing A",
     "key_1" : "Data for key one",
     "key_2" : "Hellowww"
 }
}

Im testing is Postman, response contains: "success": 1,"failure": 0

To mention: when app is in foreground state i see my code parses the messages, when app is in background i see push is handled by the system. So what could be the reason when app is killed notifications not come?

On some devices - LeEco Le2, battery optimization is off.

TooLazy
  • 836
  • 4
  • 11
  • 29
  • Possible duplicate of [How to handle notification when app in background in Firebase](https://stackoverflow.com/questions/37711082/how-to-handle-notification-when-app-in-background-in-firebase) – Gastón Saillén May 29 '18 at 15:27
  • also read here https://github.com/firebase/quickstart-android/issues/41#issuecomment-306066751 – Gastón Saillén May 29 '18 at 15:33
  • The reason is those devices use a Background execution strategy which restrict any background service from running. I ahave faced same problem in some devices even running on API21(Xioami). Well there is a AutoStart option in setting turn it on . – ADM May 29 '18 at 15:34
  • @GastónSaillén in accepted answer Antonio pointed to data message. As you can see i use it too. – TooLazy May 29 '18 at 20:21

0 Answers0