Search code examples
iosfirebasepush-notificationfirebase-cloud-messagingfirebase-console

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?


Solution

  • 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"
            }
         }
      }
    }