我正在创建一个闹钟应用程序,可以持续播放我设置的声音。现在,当我在闹钟响起时单击通知时,闹钟会停止,应用程序会打开。 有没有办法打开应用程序,但在点击通知时保持声音播放?
-(void) scheduleLocalNotificationWithDate:(NSDate *)fireDate
UILocalNotification *notification = [[UILocalNotification alloc]init];
notification.fireDate = fireDate;
notification.alertBody =@"Wake up!";
notification.soundName = @"sax.mp3";
[[UIApplication sharedApplication]scheduleLocalNotification:notification];
[notification release];
答案 0 :(得分:1)
您可以让闹钟响起,但再次播放相同的音乐。我的意思是在闹钟停止后 - 你的音乐也会停止。但是,当应用程序打开时,您再次运行相同的音乐