error when accessing sqlite DB when app is in the background - Error code 1: no such table

Please provide the following:

  1. SDK Version: 40
  2. 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:

  1. Can I access sqlite db when the app is in the background?
  2. Do I need to set any specific Data Protection, and if so how?
  3. Any other thoughts of what might be causing this issue? (again, it does work on Android, so it is iOS specific).
  4. Anyone else with similar issue?

Thanks for any suggestion!

Any suggestions?
Someone else faced similar issue?
@charliecruzan - any chance you have suggestions?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.