KAREEM MAHAMMED
KAREEM MAHAMMED

Reputation: 1695

UILocalNotification is not playing sound in iphone?

Hi I am using UILocalNotification in my application.

It works fine in simulator.

It gives alert and sound as well.

But when I tried installing this app on device, it shows the alert when notification comes but sound is not getting played.

Please Help.

Upvotes: 0

Views: 2284

Answers (3)

Kof
Kof

Reputation: 25253

Make sure that the CAF file is copied to the project's target.

You can do that by selecting the file, then in File Inspector see if Target Membership has your target selected. If it doesn't - that's your problem.

Upvotes: 0

Akshay
Akshay

Reputation: 5765

If you are using UILocalNotificationDefaultSoundName, I am quite sure it is an iOS bug. I have tested and found that the sound does not play on iOS 4.3 but works on 4.3.1 and later.

Upvotes: 1

Ivo Leko
Ivo Leko

Reputation: 730

You are using wrong .caf file format, or you are not using .caf at all.

To create a .caf file, use your iTunes.

iTunes -> preferences -> Import Settings -> import using : select AIFF encoder, make custom settings if you want click OK, again OK

then select music from your library and click: advanced -> create AIFF version drag & drop new generated file on desktop and change extension from .aif to .caf

that's it, you have .caf file that will work on your iPhone device

Upvotes: 2

Related Questions