如何通过 Firebase FCM 控制台发送带有自定义声音的推送通知
How to send Push Notifications with custom sounds via the Firebase FCM Console
是否可以通过 Firebase 控制台或 Firebase 消息编辑器自定义通知声音?它似乎只有 Enable/Disable 声音的单一属性,仅在附加选项部分。如果不可能,我有什么选择?
在您的应用程序的资源文件夹中使用声音通知编译您的应用程序后
然后,您可以使用 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"
}
}
}
}
是否可以通过 Firebase 控制台或 Firebase 消息编辑器自定义通知声音?它似乎只有 Enable/Disable 声音的单一属性,仅在附加选项部分。如果不可能,我有什么选择?
在您的应用程序的资源文件夹中使用声音通知编译您的应用程序后
然后,您可以使用 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"
}
}
}
}