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:

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





All Articles