I added the following method to my app delegate and enabled background fetch in capabilities:
-(void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
NSLog(@"Background fetch started...");
completionHandler(UIBackgroundFetchResultNewData);
NSLog(@"Background fetch completed...");
}
When I run my app on my device and go to Debug-> Simulate Background Fetch, the background fetch ran twice. It works fine on the simulator. Is this a bug or I'm doing something wrong? Is there any workaround?