0

When using FCM Notification Channels - it is no longer possible to change the Notification Sound when a notification arrives (using SetSound()). This is causing me a problem when my app receives a notification while the audio of a previous notification is playing. Our notification sound bites are 2-3 seconds long each, and when the second notification arrives, it cuts the first notification's audio off.

Instead of delaying the second notification from displaying, I would like for the second notification to display, but not play any audio. Is this possible?

binncheol
  • 1,247
  • 3
  • 20
  • 37

1 Answers1

0

I don't think you have that level of control over how Android displays/plays incoming notification messages.

The only approach I can think of is taking full control of the display of the messages in your own application code, by using data messages instead of notification messages.

Reminder: Firebase Cloud Messaging has two message types: notification messages, and data messages. Notifications messages are automatically handled/displayed by the OS when your app is not active, while data messages are always delivered to your application code.

From within your application code, you can then use the Android notification API to build the exact display of the message that you want, and display it exactly when you want it (within the notification settings of the user of course).

Frank van Puffelen
  • 418,229
  • 62
  • 649
  • 645