Unable to create record in public cloudkit database for missing/not authenticated iCloud user

While testing record creation in public CloudKit database for authenticated user I am able to do so without any issues. But for devices missing iCloud account or authentication expired I am seeing the below error:

▿ <CKError 0x97a959200: "Permission Failure" (10/2007); server message = "CREATE operation not permitted"; op = 67331DE3AF3DD666; uuid = 1F3ACD4F-A799-4CD4-ADF0-EDE9E12F2DCB; container ID = "***">

  • _nsError : <CKError 0x97a959200: "Permission Failure" (10/2007); server message = "CREATE operation not permitted"; op = 67331DE3AF3DD666; uuid = 1F3ACD4F-A799-4CD4-ADF0-EDE9E12F2DCB; container ID = "***">

I am unable to add create/write permission to _world security role in dashboard.

Is this something not supported by Cloudkit? Only authenticated iCloud users will be able to create and write data to public database as well?

Answered by DTS Engineer in 877385022

Yes, only authenticated iCloud users can create and write data to a CloudKit public database. This is mentioned here in iCloud Design Guide. To quote:

"For a running CloudKit app, a container’s public database is always readable, even when the user is not signed in to their iCloud account on the device. Saving records to the public database and accessing the private database requires that the user be signed in."

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

_world security permission gives anyone with or without an iCloud account the ability to create, read or delete a record. So why would you even want to give the user without an iCloud account permission to create or delete a record?

Yes, only authenticated iCloud users can create and write data to a CloudKit public database. This is mentioned here in iCloud Design Guide. To quote:

"For a running CloudKit app, a container’s public database is always readable, even when the user is not signed in to their iCloud account on the device. Saving records to the public database and accessing the private database requires that the user be signed in."

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Unable to create record in public cloudkit database for missing/not authenticated iCloud user
 
 
Q