我在我的 iOS 应用程序中使用 Firebase 推送通知.虽然我可以通过发送以下有效负载来发送通知,但收到时它不会播放声音.
I am using Firebase push notifications in my iOS Application. Although I am able to send the notification by sending below payload, it doesn't play a sound when received.
{
"to": "myToken",
"notification": {
"body": "test",
"title": "test"
},
"priority": "high"
"sound": "default"
}
如果我从控制台发送测试消息,它运行良好并播放通知声音.
注意:
If I send the test message from console, it works well and plays notification sound.
Note:
https://fcm.googleapis.com/fcm/send
你的 JSON "sound" : "default"
应该在 "notification"
键内JSON 的根.这个 JSON 应该可以工作.
your JSON "sound" : "default"
should be inside the "notification"
key not in the root of the JSON. This JSON should work.
{
"to": "myToken",
"notification": {
"body": "test",
"title": "test",
"sound": "default"
},
"priority": "high"
}
这篇关于iOS 中的 FCM 通知在收到时不播放声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!