【发布时间】:2021-04-20 23:22:38
【问题描述】:
我以这种方式使用Cloud Functions 和GoogleCloudMessaging 向我的客户端应用发送通知:
const notificationContent = {
notification: {
title: `${senderName} has sent you a message`,
body: `${messageString}`,
icon: "default",
sound: "customNotificationSound",
},
};
return admin.messaging()
.sendToDevice(notifToken, notificationContent)
.then((result) =>{
console.log("write done correctly");
});
我想使用自定义通知声音而不是默认声音;所以我遵循了一些在线指南,例如 this、this 和 this,但他们似乎没有回答我的问题。
由于我是从云端功能发送推送通知,是否还需要在客户端 Main Bundle 中加载声音文件(我试过了,实际上似乎不起作用)。
或者我必须将其上传到其他地方吗?
附:声音文件扩展名也是.wav,所以应该没有问题。
【问题讨论】:
标签: node.js google-cloud-functions apple-push-notifications google-cloud-messaging