8

Firebase IOS push notification doest not work when app is closed. I have followed all the steps as in documentation

1
  • Describe your Error ? and what u want ? and what is your code ? Commented Jun 21, 2016 at 3:45

3 Answers 3

9

It's a quick fix, simply add "priority": "high" in your payload next to "notification" etc. and the iOS Notification will work when the app is in the background.

So this will work:

"to":"TOKEN ID",
"notification" : {
  "body" : "test"
},
"priority": "high"
}
1
  • I'm stuck in a similar issue, I'm sending data notification instead of normal push notifications and can not receive data from notifications when the app is closed (not even running in background). Is there a workaround for this? Commented Dec 28, 2017 at 14:09
0

What worked for me was simply adding title to the notification like this:

"notification" : {
  "title": "foo",
  "body" : "bar"
}
0

Please try with this, hope it works:

POST https://gcm-http.googleapis.com/gcm/send
{
    "to": "TOKEN_ID",
    "priority": "high",
    "notification": {
        "title": "foo",
        "body": "bar"
    }
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.