Reputation: 59
I am developing a app that use the background fetch.
I would need that the function it execute in background each 5sec, but with the code that I saw in google, the SO decide when the function should to be call.
I would want the this function it execute each 5sec.
The my code is here:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
return YES;
}
Upvotes: 4
Views: 1219
Reputation: 9944
There's no way to do this. iOS is responsible to decide when it's best to give your app a chance to fetch content:
At appropriate times, the system gives background execution time to the apps that support this background mode, launching the app directly into the background if needed.
(From the docs)
Upvotes: 1