我正在使用 Firebase 云消息传递并为我的通知创建一个 cron,而不是使用 Firebase 控制台。我想知道我是否可以使用我用于 android 的相同 json。目前我的 android 设备收到我发送的通知,但在我的 iOS 中它没有。我想知道是否因为我在 notification
对象中使用的某些参数,例如 icon
仅适用于 android 平台,它会影响结果吗?
我的发帖请求是这样的
{
"registration_ids" : $ids,
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark"
"icon" : "myicon"
},
"data" : {
"Nick" : "Mario",
"Room" : "PortugalVSDenmark"
}
}
更新
按照建议,我为我的 iOS 和 Android 创建了两个不同的 cron,在我的 iOS 中我只是删除了 json 中的 icon
参数。但我仍然没有收到任何通知。
同样在 Capabilities Tab -> Push Notifications
下,我将其切换为 ON
,同样在 Background Modes-> Remote notifications
中。
最佳答案
要在 iOS 上运行 Firebase 推送,您必须将 priority
设置为 high
。引用:
Can't send push notifications using the server API
关于android - 无法在 iOS [Firebase] 中接收通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37587311/