1

I have implemented background fetch in my app. and everything works very good when I use following option from xCode menu

Debug -> Simulate Background Fetch

When I do this, the webservice gets run and all data is back up on the server as expected.

but when I use device normally it never gets updated on server. Its like background fetch is never being called.

I am using following as said in Docs

UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplication.backgroundFetchIntervalMinimum)

and all other stuff is simple code that is updating server with very short amount of data.

PROBELM AND WHAT I WANT: I do not know why the background fetch is not called even I have opened app many times and closed it many times to get the background fetch. for check I have ran query on server side but data is not updated by app. Where as when I ran the app with Xcode --> Debug --> Simulate Background Fetch my server gets updated with latest data.And every thing work as expected

Please let me know what could be possible reason of this behavior? am I missing something?

A.s.ALI
  • 1,992
  • 3
  • 22
  • 54
  • It can take several days of your app running on the device before background fetch is called. You should also ensure that you call the completion handler correctly, and relaunch the app manually after you terminate it from Xcode – Paulw11 Sep 19 '19 at 10:38
  • I did not get your point, why it will take days to run background fetch Secondly I am calling completion handler correctly. I did relaunch app manually – A.s.ALI Sep 19 '19 at 10:40
  • It just seems to. Even with a minimum background fetch interval, it seems to take a while before iOS will initiate a background fetch – Paulw11 Sep 19 '19 at 11:04
  • its been couple of days now – A.s.ALI Sep 19 '19 at 11:32

0 Answers0