I am developing iphone application where i want to develop feature of taking backup of files inside the application on to the server for every hour even if the application is completely closed.
I have tried to use NSLocalNotification but it is not calling method
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
in appdelegate. The notifier showing alert box with the buttons cancel and view , If I click in view it opens the application but not calling the method. Even if user say cancel then also it should call this method.
So it is not calling web service to take backup of files. Can any one please direct me to link which does the same.
Thanking You,
Rohit Jankar
You really can’t do what you want. Since iOS does not allow application to run in the background unless it’s is a
VOIPclient, AudioPlayer or track the user location.The problem with the solution with
UILocalNotificationis that iOS handles the notification. When the user clicks cancel your app does not get informed about this. You can only handle the view button clicks.The
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notificationis only called if you app is run or is restored from background running.If you app gets start by the system when you user click view on the Local notification you will need to check if there is a notification in the
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptionsmethod: