Asqan
Asqan

Reputation: 4489

How to share data between cordova apps using cordova-plugin-file? (Android, IOS)

I have two apps that they both should write/read some txt files. The most logical way is doing this using cordova-plugin-file. However, i could not find directly a resource explaining it explicitly.

The good news is that there is a URL called shared directory cordova.file.sharedDirectory which is exactly what I need but it is only for BlackBerry 10. (While I need them for android and IOS)

For android:

from the docs of the plugin;

If the SD Card was mounted, or if a large internal storage partition was available (such as on Nexus devices,) then the persistent files would be stored in the root of that space. This meant that all Cordova apps could see all of the files available on the card.

If the SD card was not available, then previous versions would store data under /data/data/, which isolates apps from each other, but may still cause data to be shared between users.

So, as far as I understand, if there is SD card, data can be easily shared (which we cannot assume that all users have SD card). Otherwise data of apps are isolated but still can be shared. But the question is how? Knowing the path of app is already enough or is there some restrictions to reach data of other app?

For IOS:

I'm absolutely not sure which URL to use to share data between apps.

Upvotes: 1

Views: 1068

Answers (1)

Alexis Cabrera Mondeja
Alexis Cabrera Mondeja

Reputation: 104

Just use cordova file transfer plugin to upload to server with app1 and then get file with app2

Upvotes: 0

Related Questions