icloudcloudkit-environmentscloudkit-js

Cloudkit JS - Is there possible to generate Api token dynamically without using iCloud dashboard


I need to access iCloud container private database data from web, so i am using cloudkit js and I can access the iCloud container private data using containerIdentifier and apiTokenAuth.apiToken.

The apiToken is genereated by using iCloud dashboard

But my requirement is I need to get iCloud containter private data which is uploded by different user, that mean my ios developer create a containter using xcode and using the same container name to every user who using my app and when the user upload their data and it'll store into their (user) own icloud container private database.

Okay, in this scenario how I would access private database from web for different user where the apiToken not generated before anywhere?

I am not IOS developer, so if any mistake on my understand, Sorry!


Solution

  • This question is a little old, so sorry if you've already figured this out. But here's my input on your questions:

    1. The only way to generate an API token is through the CloudKit Dashboard.
    2. You can access iCloud database through the Swift APIs and the CloudKit JS API, yes.
    3. Yes, you can access CloudKit through their Web Services APIs here: https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitWebServicesReference/index.html#//apple_ref/doc/uid/TP40015240-CH41-SW1

    I hope that helps!