user40987
user40987

Reputation: 101

iOS alarm clock, keep alarm sound playing

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];

Upvotes: 2

Views: 562

Answers (1)

user3606344
user3606344

Reputation: 26

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

Upvotes: 1

Related Questions