Abhinav
Abhinav

Reputation: 38142

Configuring the sound played when Push Notification is received

How can we configure the sound which gets played when an application is in the background and a push notification is received?

Upvotes: 1

Views: 2879

Answers (1)

esqew
esqew

Reputation: 44698

Check out the "The Notification Payload" section of this document.


Example JSON Payload (adapted from above document):

{
    "aps" : {
        "alert" : "You got your emails.",
        "badge" : 9,
        "sound" : "bingbong.aiff"
    }
}

The key you're looking for here is sound, it's a string that points to an aiff, caf, or wav file within your bundle.

Upvotes: 9

Related Questions