Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS location reliability #1114

Merged
merged 5 commits into from
Jun 30, 2020
Merged

iOS location reliability #1114

merged 5 commits into from
Jun 30, 2020

Conversation

jvisenti
Copy link
Contributor

@jvisenti jvisenti commented Jun 25, 2020

Description:

Addresses several reliability issues with location tracking on iOS:

  • Fixed Realm encryption key retrieval while device is locked
  • Fixed Realm read/write while device is locked
  • Fixed serial queue behavior for GPSSecureStorage
  • Updated background geolocation dependency to use improved location provider (see this PR)
    In order to improve reliability while the app is backgrounded, this PR configures the location provider with saveBatteryOnBackground: false. This simply enables default location updates while the app is backgrounded. From some initial testing this didn't appear to be too significant an energy drain, but if further testing reveals battery usage is an issue then this can be changed to true. If set to true, location updates will behave the same when backgrounded as when terminated, which has some serious limitations (see note below).

Linked issues:

https://pathcheck.atlassian.net/browse/SAF-257

How to test:

Ensure locations are more reliably logged while the app is

  1. In the foreground
  2. In the background
  3. After the app is terminated (can manually terminate for testing)

Note that once the app is terminated we have to rely on coarse location updates from either region (geofence) events or significant location changes. At best this means our app will be woken up to receive location updates every ~100m.

@mattThousand mattThousand force-pushed the ios-location-reliability branch 5 times, most recently from 630f67f to d3b2910 Compare June 26, 2020 00:46
@jvisenti jvisenti force-pushed the ios-location-reliability branch 6 times, most recently from 5771c8f to 76257a4 Compare June 30, 2020 15:50
* Fixed encryption key retrieval while device is locked
* Fixed writing to GPS Realm db while device is locked
* Removed redundant wrapper for GPSSecureStorage
@jvisenti jvisenti merged commit 9ea63d3 into develop Jun 30, 2020
@jvisenti jvisenti deleted the ios-location-reliability branch June 30, 2020 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants