Skip to content

Conversation

be-ndee
Copy link

@be-ndee be-ndee commented Jan 13, 2018

This changes provide a new iOS Location called "Shared" which uses the AppGroup-ID to access a shared directory. If you set the iosDatabaseLocation to Shared and you set the preference SqliteExtAppGroupId in the config.xml to your AppGroup-ID, than the database can be used in the shared directory for your AppGroup.

I have to admit, that this is a very "fast" and simple way of adding this functionality, so I'm not sure if it's the right way. But it's working for me and I need it in a project.

@brody4hire
Copy link
Owner

Thanks @be-ndee for the nice contribution. In general I like the way this enhancement was coded.

That said, I would probably rework it in one of the following ways:

  • shared group ID as an option in the openDatabase call, which would be given instead of location or iosDatabaseLocation
  • iOS database directory URL in openDatabase call, directory URL would come from another plugin

For the second alternative there should probably be another plugin to lookup the directory path URL, based on the shared group ID.

@brody4hire
Copy link
Owner

@be-ndee
Copy link
Author

be-ndee commented Jan 16, 2018

I've added some changes. I removed the "Shared" location and provided a new option called iosDirectoryURL where you can set the directory used in iOS. In the Objective-C code, the iosDirectoryURL and dbName are concatenated.

@brody4hire
Copy link
Owner

Thanks @be-ndee for what looks like a wonderful contribution. I will probably need 1-2 weeks to test and integrate due to some other, pressing issues.

@be-ndee
Copy link
Author

be-ndee commented Feb 8, 2018

@brodybits what's the current progress of this pr?

@brody4hire
Copy link
Owner

It may be another 1-2 months due to some client support needs and other pressing issues. My apologies.

@brody4hire
Copy link
Owner

Please feel free to maintain and publish your own fork until I get a chance to deal with this one. I will likely support the arbitrary database location for all 3 mobile platforms Android/iOS/Windows at the same time, in a new major release.

@be-ndee
Copy link
Author

be-ndee commented Feb 8, 2018

Thanks for the fast reply, you don't need to apologize. Just wanted to know, what's up at the moment ;)

Good idea to do it in a major release, which is more tested and not a fast-fix, like I did it ;)

Thank you anyway! :)

@brody4hire brody4hire changed the base branch from cordova-sqlite-ext-master to cordova-sqlite-ext-2.x February 14, 2019 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants