php-firebase-cloud-messaging icon indicating copy to clipboard operation
php-firebase-cloud-messaging copied to clipboard

Android sound Android O+

Open steks89 opened this issue 5 years ago • 1 comments

For android 26+ setting sound doesn't work anymore. We need to create a channel on android. So, this code not gonna work on newer versions of android. $notification->setSound('police.wav'); this will $notification->setSound('police.wav'); //old versions of android and ios $notification->setJsonKey('android_channel_id', 'noti_push_app_1'); //new android Maybe, we could have something like $notification->setSound('police.wav', 'noti_push_app_1' /*this part not been required*/); or $notification->setChannelId('noti_push_app_1');

steks89 avatar Feb 21 '20 01:02 steks89

@steks89 thanks for the new version. I can receive the notification with my channel id but i don't have the sound. I think that the device can not find the audio file. What is your plugin.xml config ?

Plugin.xml resource-file src="res/raw/custom.wav" target="app/src/main/res/raw/custom.wav"

juuulienr avatar Feb 21 '21 00:02 juuulienr