Export & Import Documents using iCloud in IOS - ios

I am developing an app that makes user to export core data records into an document using iCloud Drive/iCloud Documents/iCloud Kit and he can able to import and access those document at another device.
I mean Export/Import of documents within devices that are using same application. Documents can be identified by unique document name for importing..
Please Give any suggestions for above task. Which one is more useful..or suggest any other useful links for above task.
1) iCloud Documents. (Documents Storage)
2) iCloud Kit.(Huge/complex amount of data)
3) Key-Value Storage.(Small amount of data)
I have successfully implemented export/import using iCloud Documents. But I am able to access the documents which are exported in same device only. As it stores with local storage..
I used iCloudSync for retrieving the documents.
https://github.com/iRareMedia/iCloudDocumentSync
Now, I am referring iCloud Kit for accessing within same app & multiple devices..
Thanks..!

I have successfully accessed the iCloud Files with same iCloud Account within multiple devices using below code
NSArray *tempArray=[[iCloud sharedCloud] listCloudFiles];
Source: https://github.com/iRareMedia/iCloudDocumentSync
It will retrieve all the iCloud files of same logged in iCloud Account that are exported from various devices..

Related

Can we import any file to our application from icloud?

I know users can upload documents to icloud from their applications. I want to access these documents from my application. Is it possible to access any documents in icloud from our application?
According to the official doc: "To locate documents in iCloud storage, your app must search using an NSMetadataQuery object". But I suspect you can't simply access the documents of other apps freely.

iCloud sync files and core data

In my app I save images in file manager and their metadata(image name,created date,notes and image path) in core data.
I want to know the best practice to sync these data using iCloud.
If you save the images in the ubiquity container they will be synchronised across devices. However you may need to store a relative pathname rather than an absolute pathname.
If you take a look at the the sample apps at the link below you will find the app uses iCloud to synchronise the Core Data database using transaction logs and it uses iCloud to synchronise the backup files the user makes. So while this is not exactly what you want it would be pretty easy to modify the code for saving the backup files to iCloud to save your files to iCloud.
You do need to remember that iOS will not automatically download files from iCloud so you would have to do that from your App prior to trying to use them on the device.
http://ossh.com.au/design-and-technology/software-development/

import/export files from/to iCloud from our application

I am working on iCloud api's for the first time. I want to import/export files (.doc,.pdf,.xls any kind of file) from/to iCloud through our application.
In our application there will be different kind of documents which the user should be able to save in cloud and, when user is using same application from different devices, all files which are saved in iCloud should fetch & show.

Sharing/Invite CoreData iCloud documents with others

With with my coreData file syncing to iCloud, can I send a link to that file or an invite to a friend (who has a different iCloud account) so we can share that info through the app?
No, you cannot do that. iCloud does not allow direct file sharing links like Dropbox.
Also, you should not be directly syncing a CoreData sqlite file. CoreData has its own syncing mechanism for iCloud, and you should not sync it as a whole file. From Apple's documentation:
You cannot simply move or copy an existing database file to iCloud.
Instead, you should use NSPersistentStoreCoordinator's
migratePersistentStore:toURL:options:withType:error: method to migrate
the database to the required location.
http://developer.apple.com/library/ios/#releasenotes/DataManagement/RN-iCloudCoreData/index.html

iCloud data sharing to all app users

I wanted to know if icloud could be used as a file sharing database for your application amongst all app users or not. If for example in my app you can save a file on icloud, can anyone who uses my app download it or only the person who has uploaded it??
Using iCloud there are no sharing options - only the user who uploaded data can access it.

Resources