DimitarStoyanoff / Notifications

FCM Notifications with images in app foreground
61 stars 41 forks source link

In Android 8.0 notification sound doesn't playing. #2

Closed weiddolo closed 6 years ago

weiddolo commented 6 years ago

In Android 8.0 notification sound doesn't playing. Why?

DimitarStoyanoff commented 6 years ago

@weiddolo This is because the importance level of the notification channel in this example is set to IMPORTANCE_LOW. Notifications with default importance and above have sounds.

Changing it to IMPORTANCE_DEFAULT will solve your issue.

I also recommend reading about importance and setting your notifications depending on your case according to the android development standards described here: https://developer.android.com/guide/topics/ui/notifiers/notifications.html#importance

weiddolo commented 6 years ago

I've added: image

image

but notification sound not playing

DimitarStoyanoff commented 6 years ago

@weiddolo It is possible that you are accidentally using the low importance channel that you already created. Make sure you're using the right channel id. You can try reinstalling the app, and check the app settings for the channels(see if yours with the right priority is there). You can also try setting sounds manually by adding .setSound(...) to the channel and/or the notification builder.