iPhone: Issue with UILocalNotification flow
<p>My requirement is, my app to get notified for every 10 mins and do some process under the notification receive event even after i close my application, so as i created UILocalNotification code as below, just for testing purpose i set a notification sound there. After i close my application and come to device home screen, i get notification sound only once and doesn't come to "didReceiveLocalNotification" event in my program.
In general, notification shows as notify alert with some body and click on "View" button there, takes to our application "didReceiveLocalNotification" event method. But i don't want to show any notify alert, and my app should get called with "didReceiveLocalNotification" event method kind of as the background process. Please advise me how can i resolve my issue with UILocalNotification API? If my app should get notified every 10 mins in the background is not possible using UILocalNotification, then what else method can i try to resolve it? </p>

<pre><code>- (BOOL)application:(UIApplication *)application 

didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    [self initLocalNotification : 600];

    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];

    return YES;
}

-(void) initLocalNotification :(int) seconds {

    // Notity after 10 * 60 seconds
    NSDate *notificationDate = [NSDate dateWithTimeIntervalSinceNow:seconds];

    if ( notify )
        notify = NULL; 
    notify = [ [UILocalNotification alloc] init ];
    notify.fireDate = notificationDate;
    //notify.applicationIconBadgeNumber = 1;
    notify.soundName = UILocalNotificationDefaultSoundName;
    notify.timeZone = [NSTimeZone defaultTimeZone];
    //notify.alertBody = @"Local notification test";
    notify.repeatInterval = kCFCalendarUnitDay;

    NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"notifiValue" forKey:@"notifiKey"];
    notify.userInfo = infoDict;

    NSLog(@"Initiate notification in %d seconds", seconds);

    // Schedule the notification
    [[UIApplication sharedApplication] scheduleLocalNotification:notify];
    [notify release];

}

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {

    NSLog(@"Notification triggerred..");
[[UIApplication sharedApplication] cancelAllLocalNotifications];
    [ self initLocalNotification : 600 ];
}
</code></pre>

<p>Thank you!</p>
