Search code examples
iosnode.jsswiftfirebaseapple-push-notifications

how to play custom notification sound in ios push notification using FCM


I'm using FCM to send push notification to iOS devices from the server but I'm getting the notification successfully but unable to play custom notification sound.

here is my payload

{
    "to":"myToken",
    "notification":{
        "title":"new message",
        "body":"Hello World!",
        "sound":"tweet_sent.caf",
        "badge": 3
    }
}

Note: Also i added 'tweet_sent.caf' file to Xcode bundle


Solution

  • thanks for your answers and comments

    It is working fine now after adding notification file in build phases (Xcode).

    For Ref: Playing a custom sound on receiving a remote push notification on iOS 12 from FCM