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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:13:03+00:00 2026-06-04T09:13:03+00:00

In my PhoneGap 1.3 offline app I’m using modified iOS local notification plugin found

  • 0

In my PhoneGap 1.3 offline app I’m using modified iOS local notification plugin found in official plugin GitHub page.

I need to schedule a repeating notification (weekly/monthly), or multiple single notifications fired on every 2 weeks, based on user defined setting.

The problem occurs when I’m trying to schedule those 26 notifications to be fired on every 2 weeks.

Currently I’m using this to achieve that:

for (int i = 1; i < 26; i++)
{
    UILocalNotification *localNotif = [[UILocalNotification alloc] init];

    if (localNotif == nil) {
        return;
    }

    NSDate *date = [[NSDate date] dateByAddingTimeInterval: i * 60 * 60 * 24 * 7 * 2];

    localNotif.fireDate = date;
    localNotif.timeZone = [NSTimeZone defaultTimeZone];
    localNotif.alertBody = [NSString stringWithFormat:@"%i: %@", i, msg];

    localNotif.hasAction = NO;
    localNotif.soundName = UILocalNotificationDefaultSoundName;
    localNotif.applicationIconBadgeNumber = 0;

    [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];        

    [localNotif release];

}

When running this on iPhone 3G or iPod Touch 2 the UI freezes for about 3 – 5 seconds which is a big no no. Is there a way to optimize scheduling notifications?

I know that using only weekly and monthly repeating notifications would solve the problem but the client wants every 2 weeks, every 2 months, and every 3 months notifications, so I need to schedule multiple notifications.

I have tried to run the loop in new thread using [NSThread detachNewThreadSelector:...] which raises new problems (crashes every now and then).

Are iPhones released after 3G that much faster that delay/froze won’t exist? I only have those 2 ancient devices to test with.

  • 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-06-04T09:13:05+00:00Added an answer on June 4, 2026 at 9:13 am

    I would suggest either performing the creation in a background thread using this: (void)performSelectorInBackground:(SEL)aSelector withObject:(id)arg

    Or I would try to rethink the process. Perhaps instead of creating a years worth of 2 week reminders at once just create a couple and set something else up to create the rest. Or maybe even just create one and store a repeating bool with it so when it fires it also creates the next one.

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

Sidebar

Related Questions

Implementing a PhoneGap app for Android and iOS, the app is using Facebook Connect
I am developing Phonegap app for iPad using jQuery mobile. My App works fine.
I am using PhoneGap 1.1.0 and iOS 5.0, and have struggled on FileWriter problem.
I am using phonegap to develop one of my iPhone app. In the index.html
In my PhoneGap/jQuery Mobile app, I'm currently using PhoneGaps' Camera API to allow the
Until PhoneGap 1.6 was released I was using a PG plugin called SoundPlug to
I'm making an PhoneGap app using Jquery Mobile, but I have a little problem
I am writing a native iPhone and Android app using Sencha Touch inside Phonegap
My phonegap OnDeviceReady event is firing on the first page of my app, but
I have a PhoneGap app that is using the Localytics services and I would

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.