diego32191981
diego32191981

Reputation: 43

How to send Push Notifications with custom sounds via the Firebase FCM Console

Is it possible to customise notification sounds via the Firebase Console, or Firebase Message Composer? It seems to have a single attribute to Enable/Disable sounds only in Additional options section. If is not possible, what options do I have?

Upvotes: 0

Views: 3460

Answers (1)

DIGI Byte
DIGI Byte

Reputation: 4163

Once you have compiled your app with the sound notification in your app's resource folder You can then use the Notification Composer to send custom payloads from the Firebase Console, including sound settings in the custom payload as key:value.

Documentation: https://firebase.google.com/docs/cloud-messaging/js/send-with-console#about

You can also invoke FCM with cloud functions with this kind of payload

"message":{
  "token":"ewrTK.....",
  "notification":{
     "title":"Breaking News",
     "body":"New news story available."
  },
  "data":{
     "title":"Notification title",
     "body":"Notfication body"
  },
  "apns":{
     "payload":{
        "aps":{
           "sound":"notification.mp3"
        }
     }
  }
}

Upvotes: 0

Related Questions