gpt4 book ai didi

ios - 如何使用 FCM 在 ios 推送通知中播放自定义通知声音

转载 作者:行者123 更新时间:2023-11-29 05:18:00 24 4
gpt4 key购买 nike

我正在使用 FCM 从服务器向 iOS 设备发送推送通知,但我成功收到通知,但无法播放自定义通知声音。

这是我的有效负载

{
"to":"myToken",
"notification":{
"title":"new message",
"body":"Hello World!",
"sound":"tweet_sent.caf",
"badge": 3
}
}

注意:我还向 Xcode 包添加了“tweet_sent.caf”文件

最佳答案

感谢您的回答和评论

在构建阶段(Xcode)添加通知文件后,现在工作正常。

引用:Playing a custom sound on receiving a remote push notification on iOS 12 from FCM

关于ios - 如何使用 FCM 在 ios 推送通知中播放自定义通知声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58973180/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com