Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7172573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:38:34+00:00 2026-05-28T15:38:34+00:00

I am making an alarm clock app and I am going to ask that

  • 0

I am making an alarm clock app and I am going to ask that one question that perhaps has been asked a million times before.

When a user sets date & time in my alarm clock app using UIDate picker and hits the home button on his iPhone or closes his phone, making my app go in the background, how can I still do a ringing sound to wake him up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:38:35+00:00Added an answer on May 28, 2026 at 3:38 pm

    You can use local notifications http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html or http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW13

    - (void)scheduleNotificationWithItem:(ToDoItem *)item interval:(int)minutesBefore {
        NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
        NSDateComponents *dateComps = [[NSDateComponents alloc] init];
        [dateComps setDay:item.day];
        [dateComps setMonth:item.month];
        [dateComps setYear:item.year];
        [dateComps setHour:item.hour];
        [dateComps setMinute:item.minute];
        NSDate *itemDate = [calendar dateFromComponents:dateComps];
        [dateComps release];
    
        UILocalNotification *localNotif = [[UILocalNotification alloc] init];
        if (localNotif == nil)
            return;
        localNotif.fireDate = [itemDate addTimeInterval:-(minutesBefore*60)];
        localNotif.timeZone = [NSTimeZone defaultTimeZone];
    
        localNotif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"%@ in %i minutes.", nil),
             item.eventName, minutesBefore];
        localNotif.alertAction = NSLocalizedString(@"View Details", nil);
    
        localNotif.soundName = UILocalNotificationDefaultSoundName;
        localNotif.applicationIconBadgeNumber = 1;
    
        NSDictionary *infoDict = [NSDictionary dictionaryWithObject:item.eventName forKey:ToDoItemKey];
        localNotif.userInfo = infoDict;
    
        [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
        [localNotif release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually I am Making an Alarm app. In that When i set the Time
I am making an Alarm clock in which i want that when the selected
I'm thinking of making an alarm clock that can wake up some systems (depending
I am making an app that allows the user to set an alarm based
I'm making a little alarm clock as a project to practice as I'm just
I am making an alarm app. This app calls an intent when the alarm
I am making an app where the user can set an alarm based on
Making a small WCF test program which is based on a Store that has
I am making an android app. I am making a service that runs in
OK, Brief recap, Was asked to create an app for work that records data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.