In creating an iPhone app, is it possible to generate a popup alert on the iphone (similar to a Push notification) when the app has been closed. A simple example would be t
Nope, you'd have to use push notifications. Your app would have to be running to display any alerts.
All the workarounds I can think of would require internet access: add an event to a calendar somehow, or again, use push notifications. urbanairship.com has a pretty straightforward push notification service you could utilize.
You can do it now! And it's really rather simple. Create a 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];
Unfortunately, no. This would require some sort of background processing for your app, and that is not allowed in the current iPhone SDK. Push notifications are the only solution I'm afraid.
If it's an issue of development effort, I know Urban Airship has some solutions to make Push Notifications easier.
Sorry buddy, not possible.
There might be solutions for a popup when the app is reopened, but not when it's closed and without push.
EDIT: Actually, yes!!, but it's janktacular. You can create an .ical file with let's say, 15 minute alerts, sync it to a caldav/webdav server and have the iPhone subscribe to it in the Mail/Contacts/Calendars settings pane. Check out Omnifocus, this is their push work around. It syncs things that are due to my MobileMe iDisk, and I subscribed to the calendar - Boom, notifications.