【发布时间】:2017-01-13 02:32:39
【问题描述】:
我在我的 iOS 应用程序中使用 Firebase 推送通知。尽管我可以通过发送以下有效负载来发送通知,但收到时它不会播放声音。
{
"to": "myToken",
"notification": {
"body": "test",
"title": "test"
},
"priority": "high"
"sound": "default"
}
如果我从控制台发送测试消息,它运行良好并播放通知声音。
注意:
- 我的授权码是正确的
- 我正在向
https://fcm.googleapis.com/fcm/send发送http请求 - 我已经在 iPhone 4、iPhone 6 和 iPhone 6S 上测试过,全部收到 无声通知
【问题讨论】:
-
我收到来自 fcm 的通知。现在,我想做一些功能,比如我什么时候会从 fcm 收到通知,应用程序应该播放声音文件,甚至不需要触摸通知消息。你知道怎么做吗 ? didRecieveRemoteNotification 只会在用户点击通知时执行。当我收到通知时,我想播放一个声音文件,比如闹钟曲调。请指导我完成它。
标签: ios firebase firebase-cloud-messaging firebase-notifications