How do you export a file from iOS when using the cordova file plugin?

I am using https://github.com/apache/cordova-plugin-file on an iOS device and I am trying to write files. I can write files normally, but according to the layout of the iOS file system, all these places where I write are private.

I assume this is due to Apple's Sandbox security model, so that each application can only see files in its own package. This is different from Android, where the location is cordova.file.externalRootDirectoryNOT private.

My question is: How do you export this file from an iOS device?

The file I am writing contains a long list of GPS locations captured by the Cordoba application that I am running. I can see the file in Xcode under the devices and export the entire container to view the file. But there must be a better way to transfer the file. Can I transfer the created Cordova file from an iOS device to a computer - perhaps via iTunes or iCloud?

I also tried using cordova.file.syncedDataDirectory, and I can write files to this place just fine. But the file does not appear in my iCloud account.

+4
source share
2 answers

You need to use itunes file sharing

File sharing support

iTunes 9.1 . , / . , iTunes. ; .

, :

UIFileSharingEnabled Info.plist YES.

, " ".

, iTunes " " "" .

.

, , "" . , . , .

, UIFileSharingEnabled info.plist YES

https://developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/CoreServicesLayer/CoreServicesLayer.html#//apple_ref/doc/uid/TP40007898-CH10-SW30

+5

@jcesarmobile , iOS. , , info.plist XCode, , UIFileSharingEnabled config.xml, , .

<gap:config-file platform="ios" parent="UIFileSharingEnabled" mode="replace">
  <true/>
</gap:config-file>

config.xml .

PhoneGap, , .

http://docs.build.phonegap.com/en_US/configuring_config_file_element.md.html#Config%20File%20Elements

+4

Source: https://habr.com/ru/post/1599016/


All Articles