问题描述
我在我的应用程序中使用 @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',},});
});
当应用程序在屏幕上打开时,上面的代码工作正常,因此我的自定义通知声音工作正常。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)