I am working on an iOS app where there is a requirement, due to which I have to update the device location to our server with an interval of one second.
I have set the 'AllowsBackgroundLocationUpdates' property of the 'CLLocationManager' to 'YES'. I have also set the Location services permission request mode to 'requestAlwaysAuthorization'. (I have also set 'LocationUpdates' in my required background mode capabilites.)
Due to this, even when my application is put in the background, the application remains awake. i.e; I can make API calls/ send socket messages even though my application is in the background.
I am aware the even for an application which does not have background modes enabled, the app remains awake in the background for a duration of about 10 seconds or more depending on battery and other variables.
When I performed tests, the app easily remains awake 2-3 hours which is sufficient for my requirement.
So, should I rely on my app remaining awake or would I need to create a 'BackgroundTask' to update the locations to the server?
Thanks.
PS: I know the above approach is battery inefficient but updates every second is what the client is demanding.