-
Notifications
You must be signed in to change notification settings - Fork 715
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
running in background mode with iPhone locked #786
Comments
My apologies for the delay. SQLITE_OPERN_FILEPROTECTION flag does NOT seem to be supported by SQLite3 source code, not even by This plugin does NOT use libsqlite3 packaged on iOS for multiple reasons. I think the best solution is to set NSProtectionKey to NSProtectionNone on opened/created database files and on default database directory ( I would recommend this kind of a solution for similar problem with SQLCipher discussed in sqlcipher/sqlcipher#156 and ccgus/fmdb#262. Marking this as wanted change for major release in June 2018 (#773) or another major release (#687). |
Also related: sqlcipher/sqlcipher#274 |
It seems you must provide NSFileManager *fileManager = [NSFileManager defaultManager];
NSString* dbdir = [appDBPaths objectForKey:dblocation];
// Containing folder
[fileManager setAttributes:[NSDictionary dictionaryWithObject:NSFileProtectionNone forKey:NSFileProtectionKey] ofItemAtPath:dbdir error:nil];
// Database file
[fileManager setAttributes:[NSDictionary dictionaryWithObject:NSFileProtectionNone forKey:NSFileProtectionKey] ofItemAtPath:dbname error:nil];
|
I am dealing with this issue right now. On iOS I am communicating to a BLE device in the background when the the phone is locked. I am not getting an error in my queries it just is not returning from the transaction. I see this issue is 4 years old. Were there any changes that would resolve this? I see the recommendation for using NSFileProtectionNone. Is that something that was or could be implemented? |
I have an iOS plugin for my project that tries to read from a database created by litehelpers/Cordova-sqlite-storage, and my plugin runs in background mode, sometimes while the phone is locked. I think SQLITE_OPEN_FILEPROTECTION_NONE has to be passed to SQLite when first opening (creating) the database for this to work.
It doesn't look like this is supported now - the sqlite3_open call in this project doesn't pass any flags. Could this be supported?
The text was updated successfully, but these errors were encountered: