0

I am sending a Push Notification from Firebase Functions using the following Javascript payload:

    const payload = {
        notification: {
            title: 'The Request Limit Has Been Reached',
            body: numberOfRiders + ' riders denied',
            sound: 'badtone.caf'
    }
};

And the .caf file is in the iOS app that this function is associated with in the same location as the rest of the files. However the notification still uses the default sound. The file is less than 30 seconds long so I have no clue what the problem is!

  • Make sure you have added your sound file badtone.caf in xcode project file and in Project -> Build Phases -> Copy Bundle Resources – Krishna Maru May 26 '18 at 04:57
  • @KrishnaMaru thanks for the tip but still no luck – Adam Dostalik May 26 '18 at 05:42
  • Are you sure you are getting Notification response in the format which is given by apple? check out the link : https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1 – Krishna Maru May 26 '18 at 06:01
  • I tried implementing their method but "aps" isn't a proper variable for sending messages with Firebase apparently. – Adam Dostalik May 26 '18 at 18:12
  • https://stackoverflow.com/a/70939615/2126077 check my answer here – Heshan Sandeepa Feb 01 '22 at 11:13

0 Answers0