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 7523787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:54:14+00:00 2026-05-30T02:54:14+00:00

I would like to schedule a local notification to fire at 7pm everyday IF

  • 0

I would like to schedule a local notification to fire at 7pm everyday IF a certain condition is met (the user hasn’t entered daily data).

How do I go about doing this?

  • 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-30T02:54:16+00:00Added an answer on May 30, 2026 at 2:54 am

    Just break it up into 3 cases:

    1. It’s before 7pm, and the user hasn’t entered their daily data yet
    2. It’s before 7pm, and the user has entered their daily data
    3. It’s after 7pm

    In case 1, you set up a notification to go off at 7pm today, and then repeat every day.

    In cases 2 and 3, you set up a notification to go off at 7pm tomorrow, and then repeat every day.

    The code to create and schedule the notification looks like this:

    UILocalNotification *dailyNotification = [[UILocalNotification alloc] init];
    dailyNotification.fireDate = nextReminderTime; // set this to 7pm today or tomorrow
    dailyNotification.timeZone = [NSTimeZone defaultTimeZone]; 
    dailyNotification.repeatInterval = NSDayCalendarUnit;
    dailyNotification.soundName = UILocalNotificationDefaultSoundName;
    dailyNotification.alertBody = @"You need to enter data for today.";
    

    Of course, if you set up an alert for 7pm today, then the user opens the app and enters data before 7pm, the notification for today needs to be cancelled.

    Alternatively (this is what I did in a similar situation), you can cancel all the notifications with [[UIApplication sharedApplication] cancelAllLocalNotifications]; and set them up again from scratch based on the application state every time the app is about to go into the background (i.e., in UIApplication applicationDidEnterBackground:. This is simpler since you don’t have to think about what notifications you set up before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to schedule alerts to the users to remind people of certain
I would like to use Linq to query a bus schedule in my project,
I am displaying a radio schedule in a List View and would like to
I'm using the CCNode class in cocos2d and would like to use its schedule:interval:
I would like to schedule a batch job in which a can execute a
I have an Outlook 2003 macro written in VBA. I would like to schedule
I would like to use a WorkManager to schedule some parallel jobs on a
I would like to be able to schedule a task at a specific time
I have 5 files that I would like to schedule to run monthly in
So I have an R file that I would like to schedule to run

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.