How to open sqlite database when app is running in background in ios
My app captures location data in the background and stores in sqlite database. It works well when the device is not locked, but when the device is locked, I cannot access the sqlite database. It always gives me an error code as SQLITE_AUTH (error code: 23). I tried the following options:
- Disable data protection from features. (Does not work)
- According to Unable to create SQLite3 database with file protection in iOS , I tried the code below:
sqlite3_open_v2 ([dbPath UTF8String], & myDatabase, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FILEPROTECTION_COMPLETE, NULL)
But still doesn't work.
Could you please help me How to access sqlite database in background.
+3
source to share
No one has answered this question yet
See similar questions:
or similar: