Post

Replies

Boosts

Views

Activity

BGProcessingTask and completionHandler behavior
I think I'm missing something conceputually with the BGProcessingTask.I've worked through the demo and built a couple of my own examples in both Swift and Obj-C.They "work" in that I can schedule tasks and they get fired and execute for some amount of time, but the completion handler is never called, instead the background task is just suspended, and of course, there is no notification that your process is about to be suspended ( other that what appears in the system log. ) In fact, just adding a couple of nested loops and some mathematicall calculations toWhat I _thought_ you could do with a BGProcessingTask was to do some computationally intensive work periodically in the background, for some number of seconds to minutes, then get told to wrap it up. Were this true, one could work along until your were told to stop, check-point your work and resume it the next time you are scheduled. Instead your process runs briefly then gets suspsended, and will resume when the user foregrounds the app, continuing to run and slow down the rest of the device -- sure you can detect when your app was returned to the FG, and message the running background asking it to checkpoint and stop, but that's considerably less usefull.Likewise, I've yet to see a BGProcessingTask that, once suspended, was reactivated ( i.e. sent a SIGCONT ) after being suspended, except when the Application was foregrounded -- though it is possible I have just not been patient enough to catch that.Can anyone verify if this is the intended ( or at least known ) behaviour?Thanx,JpS
2
0
1.6k
May ’20