Reputation: 181
I need to play the default push notification sound in my app, this is possible ? from my understanding i can play specific sound if i have the sound ID. can i play the chosen "default" sound in my app ?
Upvotes: 0
Views: 425
Reputation: 14571
You can play any sound that you want. By default we play the default notification sound only.
The payload should be like this
{
"aps": {
"alert": "Alert Message",
"badge": 1,
"sound": "default"
}
}
Just pass "default"
in sound key.
If you want to play a custom push notification sound, pass the sound name with extension for example "mynotifsound.caf"
in sound key and make sure the file with mynotifsound.caf should be present in app's bundle.
{
"aps": {
"alert": "Alert Message",
"badge": 1,
"sound": "mynotifsound.caf"
}
}
Upvotes: 2