[英]how to play custom notification sound in ios push notification using FCM
我正在使用 FCM 从服务器向 iOS 设备发送推送通知,但我成功收到通知但无法播放自定义通知声音。
这是我的有效载荷
{
"to":"myToken",
"notification":{
"title":"new message",
"body":"Hello World!",
"sound":"tweet_sent.caf",
"badge": 3
}
}
注意:我还将“tweet_sent.caf”文件添加到 Xcode 包中
请将notification
键替换为aps
,例如:
{
"to":"myToken",
"aps":{
"title":"new message",
"body":"Hello World!",
"sound":"tweet_sent.caf",
"badge": 3
}
}
并将声音tweet_sent.caf
文件添加到您的项目资源位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.