Search code examples
swiftxcodecloudkit

I'm receiving an Error while trying to delete records from CloudKit Public DataBase


  • I am able to delete records from the CloudKit web interface (in both Development & Production)
  • I am able to delete records by code in the development environment
  • I Receive an Error massage while deleting by code in the Production environment. (the error message is in the comments below)

I use the following code to delete records:


Solution

  • Sign in to the CloudKit Dashboard and review the security rules you have set. Select your CloudKit container (that has your public database in it) in the left nav.

    Here are is what you can check:

    1. Container Permissions - Does the Apple ID you are using on your Mac have permission to access that container?
    2. Security Roles - Click any link to go into your container (like Data). Then click the large, bold text in the upper left (probably set to "Record Types" right now) and select Security Roles. Does your role type have permission to Write to the record type you are trying to edit?
    3. iOS Simulator - One common mistake it to not be signed into an iCloud account in the iOS simulator. Be sure to go into the Simulator's Settings and sign in.