iphone不播放通知声音

时间:2011-11-09 09:32:45

标签: iphone ios notifications

我在通知中添加了声音,但没有播放。

我试过这些:

notif.soundName = UILocalNotificationDefaultSoundName;

notif.soundName = @"sound.caf";

帮助??

1 个答案:

答案 0 :(得分:0)

您的完整代码(仅限声音)是否如此?

UILocalNotification *notif = [[UILocalNotification alloc] init];
notif.firedate = //Whenever
notif.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];

如果你的代码签出,那么它一定是iPhone的问题。它在模拟器中有效吗?