How can I access my own iOS application database from each other

I am developing two iOS applications and I want to access their database from each other.

Eg. APP1 and APP2 developed by me, APP1 can access the APP2 database and vice versa

I read somewhere that the same iOS application developer has sandbox access privileges to access his own developed iOS application.

+5
source share
3 answers

Yes you can do it. You create an application group, put both applications in the same application group. Any files created in the common file area are available for both applications. It works just like the extension shares files with its host application.

I am currently using this to share an SQL database between two different applications.

Access to the shared file can be obtained through the file manager:

NSFileManager* fileMgr = [NSFileManager defaultManager]; NSURL* sharedDirectory = [fileMgr containerURLForSecurityApplicationGroupIdentifier:appGroupId]; 
+2
source

It is true that you cannot access files from one application to another.

AFAIK you can use a common keychain to exchange data between two applications. Check it out here: How to share data on connections between iOS applications

But maybe another suggestion will help you: we developed the iOS application using the CoreData and Ensembles Framework from Drew McCormack to use iCloud Sync. ( https://github.com/drewmccormack/ensembles )

With this feature (iCloud Sync), it can synchronize data between CoreData databases, and both of your applications can use the same data.

-1
source

No, you cannot access the database in one application from another application. (Sandbox)

Because the database is private to the application.

-2
source

All Articles