سؤال

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