Open appzer opened 5 years ago
I have the same problem, any news?
I think it a android restriction! Custom sounds you only can set up with notifications channels. For each sound i created a notification channel > it works.
var push = PushNotification.init({ android: { senderID: "", sound: true, vibrate: true, clearNotifications: true, // clear notifications from shade on app start forceShow: true // }, ios: {}, windows: {} });
PushNotification.createChannel(() => {},() => {},
{
id: '',
description: 'Custom Sound',
importance: 5,
vibration: true,
sound: 'ring_and' //The file is in res/raw
});
This code is not working in latest android phone.
This is not a plugin issue, just Android API changes. See https://developer.android.com/training/notify-user/channels and use Notification Channel API like @puntiwari wrote above.
i have only a question about custom sounds in push notifications
Android <=7 works when i set the sound name
Android >=8 do not work. I only get it to work, when i create channels with defined sounds. Is this the only way to use custom sounds in Android 8 and higher???
Kevin