0

Currently, I have implemented the Firebase Cloud Messaging on my application. The notification is function in foreground and background.

When I run the app on emulator, the sound is play with the default music. Once I run on a real Android device, there is the notification but without any notification sound. Can someone show me where is the problems?

CLKH
  • 137
  • 1
  • 5

1 Answers1

0

Set a higher priority in the JSON you send to the client, you have all the documentation here:

https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message

Gabriel Costache
  • 859
  • 1
  • 6
  • 17
  • Do you have any sample format to put the priority when sending the notification? I have try a few way but it still doesn't work. – CLKH Nov 26 '20 at 08:22
  • Solution is found and the format should be data:{notification:{sound: default, ...}} – CLKH Nov 27 '20 at 14:50