I have the following:
In Settings, Capabilities I have background fetch checked.
In appDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
return YES;
}
- (void) application:(UIApplication*) application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
NSLog(@"A fetch got called");
completionHandler(UIBackgroundFetchResultNoData);
}
BUT, when I debug the code on the iPhone the performFetch doesn't fire except when I hit "Simulate Background Fetch" in the debug menu. Isn't the phone supposed to periodically fire this on its own? What am I missing?