AndyIbanez / andyibanez-com

Static website.
1 stars 0 forks source link

posts/common-reasons-background-tasks-fail-ios/ #18

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Common Reasons for Background Tasks to Fail in iOS • Andy Ibanez

https://www.andyibanez.com/posts/common-reasons-background-tasks-fail-ios/

bjornholmthorsson commented 3 years ago

I would like to ask your advice, If I'm building an app that requires background processing to update location on a periodic basis, would you recommend the new classes on IOS or something else. At the moment I'm getting very unreliable updates, sometimes every 10 minutes or even never on many occasions.

bjornholmthorsson commented 3 years ago

I'm using c# code by the way, can that make any difference?

AndyIbanez commented 3 years ago

These new Background Tasks APIs are not for background location updates. Instead look into configuring the right background modes for your app. There is a background mode for location updates.

As to how to do it with Microsoft's tools, I unfortunately have no clue.

manolis07gr commented 3 years ago

Hi Andy,

My app needs to resume execution in the background once a user triggers (enters) a pre-defined geofence (CLRegion). This works but even with background tasks I only get 30-40 seconds of execution time. My question to you is, if precise location updates are needed for 3-5 min after a user enters a geofence (triggering the app to come to the background from a suspended or terminated state), is there any hope of extending background execution time to get them? Or I am out of luck completely.

Thanks!

jamespet77 commented 3 years ago

Andy~ I am trying to update my quick actions based on time of day (Doesn't need to be exact). But I can not get a background task to fire at all. It's been days on my test devices with no action. I can simulate, but the actions still only fire once I bring the app back into the foreground. Background App Refresh is enabled. Any help is appreciated.