KorryRogers
Posts: 0
Joined: Fri Aug 15, 2014 2:53 am

Specify a Custom Push Notification Sound via Code

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Specify a Custom Push Notification Sound via Code

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

Return to “Issues”