【发布时间】:2020-04-14 23:55:47
【问题描述】:
我已配置远程通知,并且一切正常。现在我想为我的远程通知设置自定义声音。我尝试了很多方法,但这些都不起作用。 我正在使用 react-native-push-notification 和 react-native-firebase。
我已在android/app/src/main/res/raw/sound.mp3 中放置了一个自定义声音文件。
我也试过soundName:"sound.mp3"
我感谢在这方面的任何帮助。谢谢。 :)
以下是示例代码:
PushNotification.configure({
onRegister: async function(token) {
},
onNotification: function(notification) {
console.log(notification);
},
senderID: 'xxxx',
permissions: {
alert: true,
badge: true,
sound: true,
},
playSound: true,
soundName: 'sound.mp3',
popInitialNotification: true,
requestPermissions: true,
});
}````
【问题讨论】:
-
请分享您的代码
-
@Rajan 服务器端还是客户端?
-
客户端代码。
-
请看 :)
标签: android react-native react-native-firebase remote-notifications react-native-push-notification