【发布时间】:2016-07-20 11:12:18
【问题描述】:
我正在从 Parse 迁移到 Firebase,并且遇到了我们的 ios 应用程序的问题。 Firebase API 不会向 ios 应用发送推送通知。 这是我发送给https://fcm.googleapis.com/fcm/send的内容
{
"to: "<registration token>",
"priority": "high",
"data": {
"customId": "<my custom id>",
"badge": 1,
"sound": "cheering.caf",
"alert": "New data is available"
}
}
服务器返回成功
{
"multicast_id":6917019914327105115,
"success":1,
"failure":0,
"canonical_ids":0,
"results":[{"message_id":"0:1468961966677585%f0f84693f9fd7ecd"}]
}
但是推送没有送达。 如果我使用 Firebase 仪表板发送推送,即使我直接使用 Token 定位,推送也会传递。
我看到另一个开发者在另一个 Stackoverflow 问题中抱怨 Can't send push notifications using the server API
我尝试了他们添加 "priority": "high" 的解决方案,但并没有解决问题。但它给了我一个线索:他们也在使用 dev/sandbox 推送证书。
我怀疑 Dashboard 可以使用 ios Development 证书,但 API 不能。该问题仅发生在 ios 设备上,因为 android 应用正在通过 API 获取推送。
是否有人可以使用 API 和开发证书发送推送?
【问题讨论】:
-
我遇到了同样的问题,但在 Android 中
标签: ios firebase push-notification firebase-cloud-messaging