2011-11-09 122 views
0

我向声音中添加声音,但未播放声音。iphone不播放通知声音

我尝试这些:

notif.soundName = UILocalNotificationDefaultSoundName; 

notif.soundName = @"sound.caf"; 

帮助?

+0

您的测试手机处于静音模式吗? –

+0

你是如何创造声音的?多久了? “afinfo sound.caf”的输出是什么? – Mats

回答

0

那么你的完整代码(声音只)看起来像这样?

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

如果您的代码检出,那么它一定是iPhone的问题。它在模拟器中工作吗?