I am trying to implement the new iOS7 app refresh. I don't think it's working properly.
I add into the info.plist
Required background modes - App downloads content from the network
In my main view controller,
UIApplicationDelegate
is set as delegateIn Viewdidload
I put in [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:1.0];
I add the following method
- (void)application:(UIApplication *)application
performFetchWithCompletionHandler:
(void (^)(UIBackgroundFetchResult result))completionHandler {
NSLog(@"Refresh from Background");
}
I plug in my iPhone and launch the app and then I got to Debug -> Simulate Background Fetch
The NSLog does not print. (If my app is in the foreground, it will put it in the background)
Thanks!
You can review apple's demo code from below link
http://adcdownload.apple.com/wwdc_2013/wwdc_2013_sample_code/52012_ios_simplebackgroundtransfer.zip
i tried fetching data in background in my app. It is working fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With