문제

I am creating an alarm clock app that continuously plays the sound I have set. Right now, when I click the notification when the alarm goes off, the alarm stops and the app opens. Is there a way to open the app, but keep the sound playing when I click the notification?

-(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];
도움이 되었습니까?

해결책

You can just let the alarm go off, but play the same music again. I mean after the alarm stops - your music stops,too. But then you run the same music again when the application opens

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top