Paul Schorey
Paul Schorey

Reputation: 1182

Create a file through a Cordova/Phonegap app that can be opened by another app (ios)?

I'm able to create and save files using cordova-plugin-file, and have been saving and accessing them from within the app to cordova.file.documentsDirectory.

The problem it seems is that all the directories that one can save to are private, Cordova-plugin-file documentation

I would like to be able to have these files saved in (or moved to) the ios blue "files" folder, so that they can be opened by other apps such as Numbers, Pages, etc. It seems so simple there has to be a way to do this, but I can't find it after more than a few evenings of searching and trying different ways.

I'd be grateful if someone could point me in the right direction.

Upvotes: 0

Views: 110

Answers (1)

Paul Schorey
Paul Schorey

Reputation: 1182

From what I can tell you can save to the documents directory "cordova.file.documentsDirectory". By default this directory is shared with iCloud, so a file saved here could be opened through the ios File folder and a user could then select the files and hit the share icon to open with the appropriate app, such as Numbers etc.

In order to turn on iCloud you have to pay the developer fee to Apple and select the options to do so. I found the article "Working with the Files App in iOS 11" to be helpful in starting this process.

I don't have the paid developer account yet, but from what I'm reading it should work once I activate one. I'm open to a better solution or critique.

Upvotes: 0

Related Questions