Copying files to/from icloud

I would like to create a sqlite application for ios. Copy the database to and from icloud so it could be picked up on a mac pro for whatever purpose and then the reverse done. Is this feasible? If not, how about Google Drive or Live?

Thank you

Yes it is feasible to integrate with iCloud. No it is not easy since you will have to do EVERYTHING with declares.

1 Like

For some people it’s location services, some people camera support, but for me, the next big improvement Xojo could add to iOS is iCloud support. It’s a complex one and I know a lot of people won’t see the value in it which is why I’m not wasting much time pushing for it, but for some of the apps I’m making, it would be huge.

So, here we are 5 and a half years later, and still not possible?
Can’t integrate with iCloud, can’t browse for a file in ‘Files’?
No Specialfolder.SharedDocuments for example?

I am so tired of getting emails from customers who don’t understand why they have to plug an iPad into a computer to drag files to a place where my apps can see them.

I cant associate my app with a file extension either.

1 Like

I will try to create a demo project with these features in the coming days.

Saving a file to iCloud is fairly easy with iOSKit using this code:

[code]Private Sub ShareFile(f As Xojo.IO.FolderItem)
Dim objectsToShare As Foundation.NSArray = Foundation.NSArray.CreateWithObject(new Foundation.NSURL(f))

Dim activityVC As new UIKit.UIActivityViewController(objectsToShare, nil)

self.PresentViewController(activityVC, true, nil)
End Sub
[/code]

You can then select Save to Files in the Sharing panel.

That’s generous, thank you.
I should mention that my main concern is getting files TO my iPad app, rather than saving from.
(although that could be of use in the future.)

Xcode has a file browser/ chooser, Xojo doesn’t
I don’t have a way to iterate through files in iCloud or ‘Files’ on an iPad, looking for the kind of files I need

So if someone puts files into iCloud\Myfiles via any means, I need to be able to list them and open them.

Yeah… supporting opening files from the Files app and having your app get launched is “on the roadmap” and isn’t even possible with declares.

It might be possible to show a dialog to select a file. I have a class in iOSKit for it, but I don’t know if it works since there were entitlement issues at the time so I wasn’t able to test properly. You can try it out to see if it works: https://github.com/kingj5/iOSKit/blob/master/Modules/iCloudStuff/UIDocumentPickerViewController.xojo_code

1 Like

Don’t want to hijack the thread but I think my question is similar. I have an app that saves file locally on the device. So if the user switches the device, the files are only on the original device where the files were saved. What’s the recommendation where to save the files that should be accessible by the same Apple ID on different devices?

The contents of ~Library/Mobile Documents/com~apple~clouddocs has local copies of files in iCloud.
I use this folder to sync my mac files to iCloud.

JIm

The user would expect the files to be available to all copies of the app.

[quote]
“How iCloud Drive works
You can store documents, keep files and folders up-to-date across all your devices, work on items and access them from anywhere using iCloud Drive. Changes applied to a copy of a file on one device will automatically sync across all your other systems.”[/quote]

If only!

Does anybody know if the next Xojo release will support iCloud document sharing?

1 Like

Doesnt look like they consider it a priority.
But there is plenty they need to attend to …

Thank you Jeff. That’s a bummer though :frowning: