【发布时间】:2018-04-25 22:04:16
【问题描述】:
当使用HTTP v1 API 向iOS 设备发送APN 时,Apple documentation 声明如果apns-priority 设置为10,则
Notifications with this priority must trigger an alert, sound, or badge on the target device
documentation at Firebase 似乎建议添加到 apns JSON 对象:
只有在 JSON POST 中使用以下内容设置优先级仅时我才会成功:
"apns": {
"headers": {
"apns-priority": "10"
}
},
当我按照文档建议发布以下内容时:
...
"apns": {
"headers": {
"apns-priority": "10"
},
"payload": {
"sound": "default"
}
},
...
a 400 - Bad Request 从 FCM 服务器返回。如果我排除 payload json 部分,则 POST 有效。
还尝试了以下方法:
...
"apns": {
"headers": {
"apns-priority": "10"
},
"sound": "default"
...
仍然收到 400 - 错误请求
如何在 SDK API JSON POST 中的 APN 上设置声音?默认声音就足够了。
【问题讨论】:
标签: firebase audio apple-push-notifications firebase-cloud-messaging