Access user's iCloud Photo Library from CloudKit Web API

I am trying to build a web site that will offer some picture enhancement services. So far I have authentication working. There's a lot of documentation regarding finding records but as expected there is not much in my App's container. I need to access the user's private data in ICloud Photos. I suspect there's a container name for that but cannot find it anywhere. Is what I want to do possible or is it a closed system?


If it's closed I'll have to put the user through the inconvenience of uploading pictures to my site so we can enhance them. If we can access their photos it'll be a much better experience for them.


Our guess at this time is that there needs to be some permissions granted by the user during signon and we need to specify a different container name in the request uri, but it's only a guess.


We rummaged around Cloudkit Dashboard to see if there is some way to ask for permissions that we missed but so far no joy.


You can tell that we are new to CloudKit . Any help you can provide will be greatly appreciated.

Accepted Reply

There is no way to access the user's photo library through CloudKit, or via web API.


Your native app would need to request access to the user's photo library on the device, and then you would have access to their photo library where you could get the photos you need and either enhance them on the device, or if that's not how your app works then upload them to your site.

  • @pdm Is the option to access the iCloud Photo Library through CloudKit or Web API available now? I know we can access the local Photos Library but I want to access the iCloud Photos Library of current user.

  • yeah.

    I also want to know if I can access album data through web api now

Add a Comment

Replies

There is no way to access the user's photo library through CloudKit, or via web API.


Your native app would need to request access to the user's photo library on the device, and then you would have access to their photo library where you could get the photos you need and either enhance them on the device, or if that's not how your app works then upload them to your site.

  • @pdm Is the option to access the iCloud Photo Library through CloudKit or Web API available now? I know we can access the local Photos Library but I want to access the iCloud Photos Library of current user.

  • yeah.

    I also want to know if I can access album data through web api now

Add a Comment

Thanks for the clarification and here is a bit of feedback.


The work we will perform is compute intensive so using the iPhone CPU is not an option. In fact, battery consumption would lead to the app's demise if we did. We were also hoping to avoid the network usage required to push photos back and forth from the phone using metered connections. Limiting our use to non-metered connections will make us less attactive to iCloud Photo users. Adding code to the Apple version of our app will be pretty simple but result in a less-than-optimal user experience.


If a user has a Mac or PC where we can run in the background perhaps, in a future release, we'll offer an app that will perform that function. That approach is also suboptimal because it complicates users' lives and it won't help those who only have tablets and phones.


In any event, we'll probably push images from the phone for processing and push them back from the server after processing. Obviously we'll default to requiring non-metered connections. If Apple ever decides to facilitate access to user pictures and video, which I believe would be a good business decision, we would apply to be in the Beta.

I'm not a graphics engineer, but I've seen some pretty impressive image manipulation software that runs locally on iOS devices.


Regardless, if our APIs don't work for you, it would be great to get bug reports filed for what would make it better. We track feature requests in the same bug database, you can file reports at https://bugreport.apple.com.