【问题标题】:Playing custom notification sound using Cloud Functions - iOS使用 Cloud Functions 播放自定义通知声音 - iOS
【发布时间】:2021-04-20 23:22:38
【问题描述】:

我以这种方式使用Cloud FunctionsGoogleCloudMessaging 向我的客户端应用发送通知:

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");
            });

我想使用自定义通知声音而不是默认声音;所以我遵循了一些在线指南,例如 thisthisthis,但他们似乎没有回答我的问题。

由于我是从云端功能发送推送通知,是否还需要在客户端 Main Bundle 中加载声音文件(我试过了,实际上似乎不起作用)。

或者我必须将其上传到其他地方吗?

附:声音文件扩展名也是.wav,所以应该没有问题。

【问题讨论】:

    标签: node.js google-cloud-functions apple-push-notifications google-cloud-messaging


    【解决方案1】:

    我解决了这个问题,答案是肯定的,您仍然需要在您的 main bundle 中上传 music file,即使您从云功能发送推送通知也很困难

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多