1

I'm looking at apple documentation, but do not see the function call to tell me how much time I have left for background fetch execution.

How do I check the time budget I have left for background fetch?

//request refresh every 90 minutes: UIApplication.shared.setMinimumBackgroundFetchInterval(90 * 60)

func application(_ application: UIApplication,
                     performFetchWithCompletionHandler completionHandler:
        @escaping (UIBackgroundFetchResult) -> Void) {
//how to check if I still have background execution time remaining?
}
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
  • AFAIK, unlike background tasks, you simply don’t have the ability to see how much is left for background fetch. Just do very quick network request and call the completion handler when the request is done. – Rob Feb 16 '19 at 15:49
  • Unrelated, you said “request refresh every 90 minutes”. That’s not what it does. You’re simply saying “never perform background fetches more frequently than every 90 minutes”, but it’s at the operating system’s sole discretion when this background fetch actually takes place. It could be much longer than 90 minutes. – Rob Feb 16 '19 at 15:52
  • I believe I've seen this option used in another project.Thank you for the correction on the background interval – Alex Stone Feb 17 '19 at 16:35

0 Answers0