tolgatanriverdi
tolgatanriverdi

Reputation: 581

IOS7 Background Fetch Triggers Too Late

I've implemented the new iOS7 Background fetch feature by setting the minimum background interval to:

 [[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum]

I've also tried other possibilities such as setting the interval to 1.0f 10.0f. But whatever I tried my application seems to triggers the

 application:(UIApplication *)application performFetchWithCompletionHandler

method like once in an hour or once in two hours but it doesn't make sense to me because I want more constant updates like in every 15 minutes. Only way that I can use these background fetch capabilities is selecting simulate background fetch option from debug menu but this way only development build is capable of using background fetch But people who are using it by installing from "App Store" doesn't have that chance What should I do to call "performFetch method" more often(at least once in 15 minutes or something like that) ? Thanks. -Tolga

Upvotes: 2

Views: 861

Answers (1)

Satheesh
Satheesh

Reputation: 11276

Quoting Apple docs here,


minimumBackgroundFetchInterval


The minimum number of seconds that must elapse before another background fetch can be initiated. This value is advisory only and does not indicate the exact amount of time expected between fetch operations.

The operating system decides the window for background execution for the app, nothing we can do about it. So when the app gets the slot, do whatever service calls you want for 30 seconds.

Also something what I read here

The more often the Background Fetch is set to work to an app, the more resources will be used. iOS protects itself and the device by applying limitations to the apps that try to use the API very often, so be cautious when setting custom time intervals. Using the predefined values provided by the iOS it might be the best option.

Upvotes: 3

Related Questions