1
我试图在应用程序启动后一分钟安排UILocalNotification
。这是我使用的代码,UILocalNotification声音未播放
-(void)scheduleNotification{
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.fireDate = [NSDate dateWithTimeIntervalSinceNow:60];
localNotif.alertBody = @"Test";
localNotif.alertAction = @"View";
localNotif.soundName=UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
}
alertView在适当的时间后显示,但没有播放声音。 我错过了什么?
在此先感谢
编辑 我在模拟器上测试它现在
可能出现[显示UIAlertView时播放本地通知默认声音?](http://stackoverflow.com/questions/3277811/play-local-notification-default-sound-when-displaying-uialertview) –
,您可能想看看这个:http://stackoverflow.com/questions/23532706/why-doesnt-my-uilocalnotification-play-any-sound – frank