React Native Firebase 消息通知声音不会在后台改变

问题描述

我在我的应用程序中使用 @react-native-firebase/messaging 推送通知。 对于自定义通知声音,我使用 @notifee/react-native this。

我当前的通知代码是:

import messaging from '@react-native-firebase/messaging';
import notifee from '@notifee/react-native';

await notifee.createChannel({
      id: 'custom-sound',name: 'System Sound',sound: 'notification.mp3',});

messaging().onMessage((remoteMessage) => {
      notifee.displayNotification({
        title: remoteMessage.notification.title,body: remoteMessage.notification.body,android: {
          channelId: 'custom-sound',},});
});


当应用程序在屏幕上打开时,上面的代码工作正常,因此我的自定义通知声音工作正常。

但是当应用在后台运行时,通知声音是认的(系统认)

那么我如何在所有情况下设置自定义通知声音。

This my notification payload

解决方法

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

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

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