Reputation: 2815
CloudKit creates a unique User record and adds to the Public database when a user launches your app for the first time. For debugging purposes, I'm trying to delete this such that CloudKit can generate a new unique ID that is different from the one before.
However when trying to delete said record using the CloudKit Dashboard, I get the following error:
invalid attempt to delete user records directly
I get the same error when trying to delete it in code using the deleteRecordWithID:
method.
Does anyone know the correct way of deleting a user record? Is it even possible? Are there any other solutions that will solve my problem by forcing a new record being created?
Upvotes: 5
Views: 638
Reputation: 3195
I found a workaround that might not be ideal but it was better than nothing. I was able to delete the user by resetting the whole development database in the development environment.
If the User in question is the same as the one you used to log in to CloudKit Dashboard, you might not be able to delete it. In that case, you can use another iCloud account and that user should get removed every time you reset development environment.
Upvotes: 2