Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android sound Android O+ #36

Open
steks89 opened this issue Feb 21, 2020 · 1 comment
Open

Android sound Android O+ #36

steks89 opened this issue Feb 21, 2020 · 1 comment

Comments

@steks89
Copy link

steks89 commented Feb 21, 2020

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');

@juuulienr
Copy link

juuulienr commented Feb 21, 2021

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants