By Hoopes


2019-01-08 00:52:17 8 Comments

I have an application that stores its files on iCloud Drive for synchronization. I'd like to write a cloud service that can also access the files.

For example, if I record a video on my app, I'd like to ask my service to download the file, and send it to a transcoding service, or something.

From the device, can I create an authenticated URL to the file? Alternatively, can I create a temporary token to send to the server, so that it can access the file? Then, when transcoding is complete, can I write back to the iCloud Drive?

I'm mostly trying to avoid uploading the entire file from the device to the server, because the files might be quite large.

I'm also trying to use iCloud Drive to support the seamless file sync between device and mac laptop without having to explicitly authenticate - that type of thing isn't supported by google drive, or dropbox, correct?

Thanks very much in advance, I appreciate any help at all!

1 comments

@Jake3231 2019-01-08 02:40:46

CloudKit

Apple offers CloudKit, which achieves something very similar to what you are describing.

If you're able to write an application both for your Mac and iOS device, you can sync data and files across devices relatively easily. For example, CloudKit allows you to store files and data in a free database, process it however you want in your apps, then re-upload it to the database. All of this happens without any explicit authentication.

The CloudKit framework provides interfaces for moving data between your app and your iCloud containers. You use CloudKit to take your app’s existing data and store it in the cloud so that the user can access it on multiple devices. You can also store data in a public area where all users can access it.

CloudKit | Apple Developer Documentation

Keep in mind that while CloudKit itself free and easy to use, there is a caveat; You have to have a paid Developer account, which costs $99 a year.

I would highly recommend you look into CloudKit and check out Apple's (outdated) CloudKit Quick Start guide to get a feel for how programming for it actually looks.

Access from Non-Apple Platforms

While CloudKit works best when used on an Apple device, it is certainly possible to interact with a CloudKit container with more platform agnostic methods.

The best solution may be to use CloudKit web services. This allows you to use either more traditional HTTP methods or JavaScript to interact with CloudKit data.

The part of CloudKit web services that has more up to date documentation is CloudKit JS, a JavaScript API for CloudKit.

Keep in mind that with either of these options, Apple says that, “You must have an existing CloudKit app and enable web services.” Details on how to setup CloudKit web service are in the linked CloudKit JS guide

@Hoopes 2019-01-08 13:06:29

Hi Jake, thanks for the answer. I'm actually looking for something that could access iCloud Drive files from (for instance) a linux server. I'd like to be able to do things with files "behind the scenes", so to speak. If there were some sort of authentication (and a URL) to a file in iCloud drive that would allow me to access the file from my linux server, that would be the solution. (Unless there actually is something in cloudkit that addresses that, and that I've missed, my apologies if so)

@Jake3231 2019-01-08 13:12:32

Thanks! I do know of a few ways to acess CloudKit on non-Apple platforms. I’ll update the answer soon.

@Hoopes 2019-01-10 03:13:08

just pinging on this - i haven't found anything legit out there yet, was wondering what you might have in your bag of tricks.

@Jake3231 2019-01-11 05:23:19

@Hoopes I have updated my answer with more information.

@Hoopes 2019-01-11 14:05:21

Thanks so much, I will check it out.

Related Questions

Sponsored Content

0 Answered Questions

How can I access the files within an iPhone's iCloud backup?

0 Answered Questions

How to access App files from iCloud on Mac OSX without jailbreak?

1 Answered Questions

[SOLVED] iCloud Drive in Finder sidebar shows incomplete circle segment

  • 2016-02-17 15:14:49
  • Jim
  • 1862 View
  • 1 Score
  • 1 Answer
  • Tags:   macos icloud

3 Answered Questions

[SOLVED] Cannot open files from iCloud drive on Mac but they open on iOS devices

  • 2015-10-11 17:44:27
  • aszekely
  • 9497 View
  • 3 Score
  • 3 Answer
  • Tags:   ios icloud

0 Answered Questions

iCloud Drive - unable to access files

  • 2017-10-17 00:09:17
  • user5797668
  • 240 View
  • 0 Score
  • 0 Answer
  • Tags:   icloud

1 Answered Questions

[SOLVED] Purge synced documents from iCloud Drive

  • 2017-08-31 10:54:17
  • nkkollaw
  • 260 View
  • 2 Score
  • 1 Answer
  • Tags:   macos icloud

1 Answered Questions

[SOLVED] MacOS Sierra how to reduce priority of iCloud drive sync?

1 Answered Questions

Access iCloud shared photo stream files on filesystem

1 Answered Questions

[SOLVED] View amount of time left when uploading files to iCloud

  • 2015-12-24 18:15:04
  • iProgram
  • 442 View
  • 1 Score
  • 1 Answer
  • Tags:   icloud

1 Answered Questions

Accessing ICloud Drive files from an iPad

  • 2014-11-11 11:19:10
  • Ilanysong
  • 638 View
  • 1 Score
  • 1 Answer
  • Tags:   ipad icloud imac

Sponsored Content