Dear community,
It is vital for my app to run for 3-5 min in the background once a user enters a pre-defined CLRegion (geofence). This needs to be the case even if the app is in the suspended case (or swiped-up by the user) and then it's brought in the background. This functionality is needed because my app needs to collect a user's accurate location while they are within the CLRegion and up to 5 minutes maximum in order to record where the user parks (either by detecting that the user disconnects from their car's audio/bluetooth or by using GPS/sensor data). Here is an outline of how my code is intended to work:
1) App is killed or suspended
2) User enters pre-defined CLRegion
3) App resumes in the background
4) App collects user's location for 3-5 minutes in background
App is sent back to "suspended" state either
(a) after 3-5 minutes collecting location have passed or
(b) if the user exits that geofence in less than 3-5 minutes.
Is this task possible with iOS 14? I have tried a lot of things, including backgroundTasks, but I never get more than 30-40 seconds of execution following a geofence crossing trigger in the background. I really look forward to your insights and expertise on the matter.