【发布时间】:2021-07-15 20:22:12
【问题描述】:
是否可以通过 Firebase 控制台或 Firebase 消息编辑器自定义通知声音?似乎只有在附加选项部分中启用/禁用声音的单一属性。如果不可能,我有什么选择?
【问题讨论】:
标签: ios firebase push-notification firebase-cloud-messaging firebase-console
是否可以通过 Firebase 控制台或 Firebase 消息编辑器自定义通知声音?似乎只有在附加选项部分中启用/禁用声音的单一属性。如果不可能,我有什么选择?
【问题讨论】:
标签: ios firebase push-notification firebase-cloud-messaging firebase-console
一旦您在应用的资源文件夹中编译了带有声音通知的应用
然后,您可以使用 Notification Composer 从 Firebase 控制台发送自定义负载,包括自定义负载中的声音设置为key:value。
文档:https://firebase.google.com/docs/cloud-messaging/js/send-with-console#about
您还可以使用这种有效负载通过云函数调用 FCM
"message":{
"token":"ewrTK.....",
"notification":{
"title":"Breaking News",
"body":"New news story available."
},
"data":{
"title":"Notification title",
"body":"Notfication body"
},
"apns":{
"payload":{
"aps":{
"sound":"notification.mp3"
}
}
}
}
【讨论】: