2014-05-05 204 views
2

我正在創建一個鬧鐘應用程序,可以連續播放我設定的聲音。現在,當鬧鐘響起時,我點擊通知,鬧鐘停止,應用程序打開。 有沒有辦法打開應用程序,但保持聲音播放時,我點擊通知?iOS鬧鐘,繼續播放鬧鐘聲音

-(void) scheduleLocalNotificationWithDate:(NSDate *)fireDate 

    UILocalNotification *notification = [[UILocalNotification alloc]init]; 

    notification.fireDate = fireDate; 
    notification.alertBody [email protected]"Wake up!"; 
    notification.soundName = @"sax.mp3"; 
    [[UIApplication sharedApplication]scheduleLocalNotification:notification]; 

    [notification release]; 

回答

1

您可以讓鬧鐘響起,但再次播放相同的音樂。我的意思是鬧鐘停止後 - 你的音樂也停止了。但是,當應用程序打開時,您再次運行相同的音樂