Background fetch was not work properly

I have done these steps:

- [x]add capability in background task - background fetch

- [x]add application.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum) in appdelegate

- [x]implement performFetchWithCompletionHandler


Result: background fetch wasn't stable ,sometimes it triggered more than 10min,sometimes it triggered more than 24 hours. I test it in three devices. Event happened in quite different time.Use Xcode - Debug - Simulate Background Fetch, the feature will work fine.


Can I change system time directly to trigger the background fetch ? I tried but background fetch unstable as well.

Could anyone give me some advices?

This may not be surprising. Background fetch is not a guarantee to allow your app to run in the background to do a fetch. There are several variable factors at the system level that may cause your app to not be launched in the background. You don't have control over those factors. It sounds like you've got things implemented correctly so that when the system is deciding it can allow your app to run in the background it is.


The only other thing you haven't mentioned is to verify that you're calling the completion handler passed to the performFetchWithCompletionHandler function within the allotted time?

Background fetch was not work properly
 
 
Q