Firebase推送通知自定义声音不起作用

问题描述

我创建了一个工具来测试项目的Firebase推送通知,并为通知添加自定义声音。自定义声音在IOS上正常运行,但在android中,某些设备会播放认声音,而不是自定义声音。

下面,我分享了我的代码。谁能帮帮我吗?预先感谢。

var registrationToken = 'YOUR_REGISTRATION_TOKEN';

var message = {
  notification: {
    title: 'Title',body: 'Body',},android: {
    priority: 'high',notification: {
      sound: 'ringing.mp3',defaultVibrateTimings: true,apns: {
    payload: { aps: { sound: 'ringing.mp3',badge: 0 } },token: registrationToken,};

admin
  .messaging()
  .send(message)
  .then(response => {
    console.log('Successfully sent message:',response);
  })
  .catch(error => {
    console.log('Error sending message:',error);
  });

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)