我在通知中添加了声音,但没有播放。
我试过这些:
notif.soundName = UILocalNotificationDefaultSoundName;
notif.soundName = @"sound.caf";
帮助??
答案 0 :(得分:0)
您的完整代码(仅限声音)是否如此?
UILocalNotification *notif = [[UILocalNotification alloc] init];
notif.firedate = //Whenever
notif.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
如果你的代码签出,那么它一定是iPhone的问题。它在模拟器中有效吗?