IPhone App - generate popup alerts when the app is closed

When creating an iPhone app, you can create a popup alert on the iphone (similar to a Push notification) when the app has been closed. A simple example would be an app that can set a reminder at 5:00 pm on January 5, 2010. The app can be closed, at which time a pop-up reminder will appear. I don't think this is possible, but would like to know if anyone has any ideas? Again, I don't want a Push solution, but rather a solution that doesn't require internet access (ie "Local" push from iPhone). Thank you.

+2


source to share


4 answers


You can do it now! And it's actually pretty simple. Create UILocalNotification.



UILocalNotification *localNotification = [[UILocalNotification alloc] init];
        if (localNotification == nil)
            return;
//Initialise notification
        localNotification.fireDate = yourDate;
        localNotification.timeZone = [NSTimeZone defaultTimeZone];
        localNotification.alertBody = [NSString stringWithFormat:NSLocalizedString(@"Hey, you've forgotten something", nil)];
        localNotification.alertAction = [NSString stringWithFormat:NSLocalizedString(@"%@", nil), buttonTitle];
        localNotification.soundName = UILocalNotificationDefaultSoundName;
        [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
        [warningDate release];
        [localNotification release];

      

+10


source


Sorry buddy, not possible.

There might be solutions for a popup when the app is open, but not when closed and without clicking.



EDIT: Actually, yes !! but he's Amber . You can create a .ical file of say 15 minute alerts, sync it with caldav / webdav server and subscribe to it on iPhone in Mail / Contacts / Calendars preference pane. Check out the Omnifocus, that's their push. It syncs things that happen from my MobileMe iDisk and I subscribed to Calendar - Boom, Notifications.

+2


source


Unfortunately no. This will require some kind of background processing for your application, and this is not allowed in the current iPhone SDK. Push notifications are the only solution I'm afraid of.

If this is a development issue, I know Urban Airship has some solutions to make Push Push easier.

0


source


No, you will need to use push notifications. Your application must be running to display any warnings.

All the workarounds I can think of would require internet access: add the event to the calendar somehow, or use push notifications again. Urbanairhip.com has a fairly simple push notification service that you could use.

0


source







All Articles