Im create application with timer and show pop ups evry 30 sec
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:viewController.view];
[window makeKeyAndVisible];
timer = [NSTimer scheduledTimerWithTimeInterval:(30)
target:self
selector:@selector(showpopup:)
userInfo:nil
repeats:YES];
}
-(void) showpopup:(NSTimer *)theTimer{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"YAHooo!" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
How change code to show pop ups in background mode
You can’t show UIAlertView when your application is in background. You can use UILocalNotification which comes in UIAlertView format, but there is a limit for number of notification for each app. To schedule UILocalNotification follow the tutorial.