iOS SDK
When an app has user focus, GPS location data collection will continue as long as the SDK has been started (and not stopped), and the user has granted either 'While in Use' or 'Always' location permission. For indoor positioning using iBeacons, the same location permission is required, and in addition, at a phone level, Bluetooth must be enabled.
When an app loses focus, but is still in the tray, location data will continue as long as the SDK has been started (and not stopped), and the user has granted 'Always' permission (for any phone), or 'While in use' permission (only phones with a notch).
When an app is terminated through force closing it, then location data collection stops. Only for users that have granted 'Always' permission, GPS data collection will restart when the user moves a significant distance (around 500m), and Indoor Position (beacon) data collection will restart when the user either goes out of range of all beacons with a UUID that was being seen, or comes into range of a beacon with a UUID that was not previously being seen.
Android SDK
While the app has user focus, GPS data collection will continue as long as the user has granted 'While in use' location permission. 'Always' permission is not required. Indoor Positioning using iBeacons requires 'While in use' location permission and also Bluetooth aka 'Nearby devices' permission from the user. Indoor positioning also requires that at a phone level, Bluetooth is enabled.
To continue gathering location data in the background, the Android SDK makes use of a 'Foreground Service'. As long as this service is running, and has not been force terminated by the user, data collection will continue.
When starting the SDK, an icon and text for the foreground service need to be provided. Without this the SDK will not start a foreground service, and data collection will become very infrequent unless the app has user focus.