0

I am creating an app that should check something in regular intervals. (Not a service call just harmless check which won't take much of CPU usage)

To run a code in background for a fixed interval of time, I tried using BackgroundTasks framework. My idea was to schedule one background AppRefresh task and schedule another when the first one gets called. Also in the whole day I tried with this framework, there were no updates. Though I always scheduled to run my job after 5 minutes, I sometimes waited for an hour for updates.

The code is working, I used the console command to simulate the background task and it worked.

I am not sure what framework I should use to achieve this?

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Arun
  • 222
  • 1
  • 10
  • https://stackoverflow.com/questions/30090309/how-can-i-make-a-function-execute-every-second-in-swift – Roman Ryzhiy Sep 07 '20 at 11:49
  • @Roman My app has to check if the user has walked in regular intervals? Is it not possible to do that? – Arun Sep 07 '20 at 12:55

0 Answers0