views:

407

answers:

3

I am trying to get a custom sound to play when my Apple push notification is delivered. The popup message displays, and the badge updates too, but I always get the default iPhone sound playing instead of my custom sound.

Here's the JSON data I am sending:

{"aps": {"sound": "sound.caf", "badge": 2, "alert": "Successfully registered device"}}

My sound.caf file is at the top level of my Xcode project, and it definitely appears in the resulting .app (as confirmed by 'view package contents' in Finder).

The sound file plays fine on my Mac. Initially I tried .caf, .m4r and .wav files, but none would play. I have also tried using one of the .caf files from an Urban Airship sample project (which I'm pretty confident must work, but admittedly I haven't tried it myself), but that didn't work either.

The Apple docs define the accepted encodings and file formats (.wav, .aiff or .caf).

I've tried very short sound files as well as longer ones (to be sure I am underneath the undocumented 30 second limit).

Has anybody got any other hints/suggestions for me to try?

A: 

My problem was that I wasn't actually updating the application on my test iPhone. I was updating the version in iTunes, but I hadn't incremented the "Bundle version", so iTunes wasn't pushing the new application to the phone.

To be sure your updated application is being copied to the phone, watch the iTunes status message carefully. It should say:

Updating applications on 'device'
Installing 'application'

If in doubt just delete the existing app from the device.

Dan J
A: 

please tell ur suggestion about my questions.

muthiah
No. You are supposed to wait for people to answer your questions, not try to force them to!
Dan J
A: 

sorry i don't know the proper approach to get the answers.. here after i wont do like this

muthiah