4

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;
}
nhgrif
  • 61,578
  • 25
  • 134
  • 173

1 Answers1

1

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)

Marcelo
  • 9,916
  • 3
  • 43
  • 52