App Clips should support CloudKit for read-only access to the public database

I'm building an app based entirely on CloudKit and I'm super excited for technologies like App Clip to make a mini 'menu' version of said app. The main app target allows vendor/site location managers to update their menu in real time and then signed in iCloud users can subscribe to those public record updates.

I just discovered in the technology limitations of App Clips that CloudKit is out. It isn't in the list of 'supported capabilities' in the project editor. Additionally, as one would expect, trying to create a CKContainer without the entitlement in the App Clip target crashes with a fatal error due to the lack of that very entitlement. This feels unnecessarily restrictive and excludes developers from supporting App Clips who build their server tech stack on CloudKit.

Write capability isn't needed for my concept. Effectively I'd want for each unique venue to be able to continue to manager their menu/venue via CloudKit + Security Roles and allow updating content in the main app--and for users to view/browse with focused location/venue specific menus in the app clip. As recommended, the full app has to be installed for the full experience.

I'd rather not attempt to hit the public database via the JS library, or making an API proxy that just invokes CloudKit web tech under the hood. I really think supporting read operations from the public CloudKit database would enable many experiences that are currently restricted due to this limitation.

If someone at Apple is watching, I created FB8528010 feature request with a little more details on my new feature concept.

Accepted Reply

I spoke with both App Clip and CloudKit engineers during WWDC 2021 in lab sessions. They're aware of the request. That having been said the temporary solution that we came to through conversation is to use the CloudKit Web Services. I've decided for my AppClip I can live with read-only access to just the public database.

I have this working and have fully mirrored the CKQueryOperation and CKFetchRecordsOperation functionality using the Cloud Kit Web Services API. This is something that I would potentially open source if others are interested in working on it with me as an interim solution until (if) official support happens.

  • I'm interested by your solution. I tried to implement myself the cloud kit web service in the target AppClip to fetch records in a public database but get an error AUTHENTICATION_FAILED. I set ckAPIToken but get always the same error. Thanks for your help.

  • magiicMedia, can you post the URL (redact your container) in here that you're using as a request or create another forum post with your issue and reference it here?

    I'm in the process of ripping out my private info from my repository and setting a public Github setup. Right now my solution supports Fetch + Query operations including cursors with most of the supported types.

    Meanwhile have a look here at some sample code: Building a CKQueryOperation URLRequest

  • Here is the SPM I'm building. Note it is subject to breaking changes as I develop it. Feel free to create issues for feature requests. CloudKit Web Services SPM

Add a Comment

Replies

Exact same situation here, I liked CloudKit's ability to identify a user for my app without needing a username and password. Without that support I either must drop CloudKit or not support App Clips....
  • I don't think that my reply which I marked as the answer would solve your need. Have you considered adopting Sign In with Apple? This IS supported in App Clips.

Add a Comment
Let's hope for an update in WWDC21 to support this!

I'm on the same situation. I created an application that fit the use of App Clip feature but without CloudKit support I have to abandon this feature. I opened request and hope that the team at Apple will add quickly the support CloudKit framework in App Clip. It push the developers to use other solutions whereas CloudKit is available (and great framework!).

Thank you.

I spoke with both App Clip and CloudKit engineers during WWDC 2021 in lab sessions. They're aware of the request. That having been said the temporary solution that we came to through conversation is to use the CloudKit Web Services. I've decided for my AppClip I can live with read-only access to just the public database.

I have this working and have fully mirrored the CKQueryOperation and CKFetchRecordsOperation functionality using the Cloud Kit Web Services API. This is something that I would potentially open source if others are interested in working on it with me as an interim solution until (if) official support happens.

  • I'm interested by your solution. I tried to implement myself the cloud kit web service in the target AppClip to fetch records in a public database but get an error AUTHENTICATION_FAILED. I set ckAPIToken but get always the same error. Thanks for your help.

  • magiicMedia, can you post the URL (redact your container) in here that you're using as a request or create another forum post with your issue and reference it here?

    I'm in the process of ripping out my private info from my repository and setting a public Github setup. Right now my solution supports Fetch + Query operations including cursors with most of the supported types.

    Meanwhile have a look here at some sample code: Building a CKQueryOperation URLRequest

  • Here is the SPM I'm building. Note it is subject to breaking changes as I develop it. Feel free to create issues for feature requests. CloudKit Web Services SPM

Add a Comment