Page 1 of 1

Specify a Custom Push Notification Sound via Code

Posted: Wed Nov 23, 2016 2:37 am
by KorryRogers

I currently send push notifications for various events in my app from my server via a JSON post. Is is possible to specify a default sound somehow? My current JSON string is this:

{"payload":{"message" : "This is the notification", "badge" : 0},"filter":{"deviceID":{"$in":[DeviceID Array]}},"status": "sent"}


Specify a Custom Push Notification Sound via Code

Posted: Wed Nov 23, 2016 7:38 pm
by Illya Stepanov

Hi Korry,

Sure, you can do this by adding to "payload" object "sound:sound.wav" - but before this the sound file should be added to your project Source files.
for iOS it will be:
precodesource/iOS/appname/www/soundFileName.wav/code /pre
emNote: that the sound file should be specified including www/... for iOS platform in the PM payload./em

for Android
precodesource/ANDROID/appname/res/raw/soundFileName.wav/code/pre