当应用关闭时,Firebase IOS推送通知不起作用

时间:2016-06-15 08:54:53

标签: ios firebase

应用关闭时,Firebase IOS推送通知功能无效。我已按照文档

中的所有步骤进行操作

3 个答案:

答案 0 :(得分:8)

这是一个快速解决方案,只需添加"优先级":"高"在你的有效载荷旁边"通知"当应用程序在后台时,iOS通知将起作用。

所以这会奏效:

"to":"TOKEN ID",
"notification" : {
  "body" : "test"
},
"priority": "high"
}

答案 1 :(得分:0)

对我有用的只是将title添加到notification,就像这样:

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

答案 2 :(得分:0)

请尝试这个,希望它有效:

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