本文介绍了iOS 中的 FCM 通知在收到时不播放声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我在我的 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 发送 http 请求 - 我在 iPhone 4、iPhone 6 和 iPhone 6S 上测试过,都收到了无声通知
推荐答案
你的 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 通知在收到时不播放声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)