0

My code is ditto same as provided by fcm docs I am recieving notification when app is closed without using intent extras or any php code.

when app is in foreground onMessageRecieved() method gets invoked so i get default sound but when app is in background or closed i dont get sound.

i am using one phone and firebase console to send message thats it no php scripts or http requests

my phone setting has max volume for notification

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Refered Only this https://firebase.google.com/docs/cloud-messaging/android/client – Mukesh Arethiya Dec 30 '16 at 14:09
  • Possible duplicate of [No notification sound when sending notification from firebase in android](https://stackoverflow.com/questions/37959588/no-notification-sound-when-sending-notification-from-firebase-in-android) – Suhaib Jul 01 '17 at 01:58

1 Answers1

1

From your firebase console (Notifications), go to Advanced options > Sound > Enable - before sending every message. Thus you'll get sound even if your app is in background. Here's a screenshot

enter image description here

Sudip Podder
  • 830
  • 11
  • 25