xcode - How do I properly enable iCloud document sync for iOS app? -


in cordova ios app, users can data file saved in documents folder within app's container, should synced icloud. however, though file saved never synced icloud, must missing something. these steps have taken:

  • icloud container registered on developer.apple.com , icloud documents capability enabled in xcode:

icloud container

  • nsubiquitouscontainers dictionary added info.plist:

icloud info

  • archive build created , uploaded app store, build released testers via test flight (note: app has gone through review process , been released app store).
  • note, cordova config.xml not contain backupwebstorage setting cloud backup should enabled (not sure whether affects document sync).
  • user saves backup file, saved app's documents folder (note: app uses cordova-plugin-file plugin save file location denoted plugin variable cordova.file.documentsdirectory):

iexplorer

at point have expected see xbrowsersync appear in storage & icloud usage settings, not:

storage & icloud usage

and neither see xbrowsersync folder appear in icloud drive app:

icloud drive

and of course never see files synced mac or on icloud.com.

clearly i'm missing can't see what. i've read many posts regarding getting working , find apple's documentation unclear , confusing i'm kind of stuck @ point. please point me in right direction?

after further reading believe know what's missing here. hadn't realised need explicitly tell ios upload file icloud document storage, allow files appear in icloud drive on user's devices.

so, need write (ios) code utilise filemanager class to:

  1. call url(forubiquitycontaineridentifier:) method in order location of local icloud container , initialise (at point app appear in storage & icloud usage settings)
  2. tell ios upload file icloud calling setubiquitous(_:itemat:destinationurl:)

i'm building basic cordova plugin this. i'll update answer link when i'm finished.

edit:

the cordova plugin developed called cordova-plugin-icloud-document-storage. implements uploading documents icloud (i.e. setubiquitous), doesn't implement other icloud functionality of filemanager class (such managing cloud updates or version conflicts). if develop functionality please submit pull request.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -