-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Notification channel capability so sounds will play in android oreo + #1026
base: master
Are you sure you want to change the base?
Conversation
update to master fork
Took a while to figure out an update. Need to use notificationChannel for a sound. Have created an app specific notification channel ID as well as a sound specific channel name. You apparently can’t update a notification channel after its created, using default channel etc just meant you used the system default and couldn’t change it.
Oreo requires use of a notification channel. Once a channel is created, it can’t be modified (could be deleted but that’s unverified as a good idea). Consequently you need to create a channel for your app plus sound combination and then use that.
Hi. I'm using your folk but I can't change the defaut sound. |
Hi Ellecito, whats your payload? Run the adb debug to see whether the payload is triggering playing a sound, and whether the file is found etc etc.
|
Hi, there is the payload after send a push test.
|
Will it be compatible with cordova 6.3.0? |
I haven’t been able to build my app with <7 for a while, welcome anyone else’s input?
There is a switcher based on android version. I’d hope that’d cover 90% of cases..
Mark
…Sent from my iPhone
On 18 Apr 2019, at 06:40, David Padých <[email protected]<mailto:[email protected]>> wrote:
Will it be compatible with cordova 6.3.0?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1026 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAT5UUIHYDPGCESZGOT4KFLPQ6DMXANCNFSM4G6J6OEQ>.
|
Hi team, @robertarnesson . I've gone further with this pull request. It now enables you to create multiple notification channels at runtime and then specify which notification channel to use. Works on Android 9 & 10. Here is an example GCM data payload (I'm sending via Google Cloudfunctions, ie admin.messaging().sendtoDevice(tokenList, payload, options).
Key thing for Android9/10 is the 'notification_android_channel_id. Back in javascript land, I am setting everything easily up with this following code. I create a default channel then I loop through the other 'sounds' that I want to offer to users:
It all works neatly. I'd love for this to be merged, and I'm sure many other users will be very happy to have a solution as previously you could only create one 'sound' and you were locked into that for the whole app duration. |
Oreo requires use of a notification channel. Once a channel is created,
it can’t be modified (could be deleted but that’s unverified as a good
idea).
Consequently you need to create a channel for your app plus sound
combination and then use that.