Skip to content
Advertisement

Сan’t set custom sound and vibration for notifications on Android Oreo+

I can’t set custom notification sound and vibration pattern for android oreo and above. For earlier versions of android everything works as it should. I wrote my code based on these answers: Custom notification sound , android Oreo?,
Custom Notification Sound not working in Android Oreo and others. But none of this had the desired result. The notification comes, but without sound and vibration. The values of isSoundEnabled and isVibrationEnabled are transmitted correctly.

My method:

JavaScript

What am I doing wrong?

Advertisement

Answer

Figured it out. The checks if (isSoundEnabled) and if (isVibrationEnabled) were unnecessary. To control vibration and notification sounds on android oreo+, you need to create separate channels.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement