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:
nsubiquitouscontainers
dictionary added info.plist:
- 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
):
at point have expected see xbrowsersync appear in storage & icloud usage settings, not:
and neither see xbrowsersync folder appear in icloud drive app:
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:
- call
url(forubiquitycontaineridentifier:)
method in order location of local icloud container , initialise (at point app appear in storage & icloud usage settings) - 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
Post a Comment