Please provide the following:
- SDK Version: 40
- Platforms(Android/iOS/web/all): iOS
My app is using expo geofencing (Location - Expo Documentation) and local sqlite db (SQLite - Expo Documentation).
The local sqlite db is used to store (i.e. write) and evaluate (i.e. read) the geofence activity.
When the app is in the foreground, everything works as expected on all devices and OS.
However, when the app is in the background I face issues on iOS 13 and above. (it does work on simulators, Android devices, and iOS 12). Trying to access the sqlite DB while the app is in the background, I face an error “Error code 1: no such table: XXX”.
When the app is in foreground again, the table is there and all the content is there too, so obviously it is not about the existence of the table.
I suspect it is something to do with iOS Data Protection - I believe it is blocking access to the db when the app is in the background. Then again, maybe it’s something else…
So - my questions:
- Can I access sqlite db when the app is in the background?
- Do I need to set any specific Data Protection, and if so how?
- Any other thoughts of what might be causing this issue? (again, it does work on Android, so it is iOS specific).
- Anyone else with similar issue?
Thanks for any suggestion!