samedi 2 mai 2015

Write into a database stored in App Group container from extension

I have a sqlite database stored in the App Group container in order to register custom shortcut.

I can read/write into it from the app, but not from the keyboard extension. It seems that the database is in read-only mode from extensions.

I'm using the following code to access it:

let appGroupDirectoryPath = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier(appGroupId)
let dataBaseURL = appGroupDirectoryPath!.URLByAppendingPathComponent("database.sqlite")

Is there a workaround to be able to write into the database from the extension keyboard, or is it completely impossible?

The database is writable from the simulator but not with real devices. I guess it's because permissions are managed differently on MacOS X and iOS.

Aucun commentaire:

Enregistrer un commentaire