I implemented the performFetchWithCompletionHandler for background fetch. I have local notifications setup to fire when there is change in data. For test purposes I also had notifications to fire even when there is no change in data so that I know things are actually working, and I don't have to wait for remote data to change to test my app).
With the app in debug mode in xcode, I use the "Simulate Background fetch" option, and background fetch works as expected. Notifications are displayed on the simulator as expected.
Deleted the old app on the phone. I connect the ip5 device to xcode and run the app. App is updated on iphone. When in debug mode, I execute the "Simulate Background fetch" option. I see local notifications as I expected.
now I have disconnected the device and I have been opening and closing the app every hour (amlost!), but background fetch has not fired even once, and I have not seen any local notification yet.
I have set the code to do this:
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
return YES;
}
What am I doing wrong?