Differences between Development and Production environments

I have an app where I added CloudKit sync. When I test the app in Xcode with a connected device and the simulator (development enviroment) everything works fine, but when I then test the app via a TestFlight build (production enviroment) with two devices it doesn't work. The schema from the Development enviroment was deployed to the Production enviroment in the CloudKit Dashboard.

Are there any differences between the Development and Production environments in CloudKit? Or is there any other common error that I could have ran into?

Accepted Reply

I discovered the problem. Sometime during development I deactivated the "Create" permission for the record for the "Authenticated" security role by accident in the CloudKit Dashboard while having the "Read" and "Write" permissions for the record for the "Creator" security role still activated. Reactivating the "Create" permission for the record for the "Authenticated" security role fixed the issue. Somehow the security roles got ignored in the Development enviroment, but were rightfully enforced in the Production enviroment.


(I just rediscovered this topic and wanted to add the solution for people that might get here via search)

Replies

Define "doesn't work"... Show any errors, etc. Is the data inconsistent, or?

I ahd to add this to my entitlements file for the build I added to TestFlight:


com.apple.developer.icloud-container-environment and set it to "Development"

I discovered the problem. Sometime during development I deactivated the "Create" permission for the record for the "Authenticated" security role by accident in the CloudKit Dashboard while having the "Read" and "Write" permissions for the record for the "Creator" security role still activated. Reactivating the "Create" permission for the record for the "Authenticated" security role fixed the issue. Somehow the security roles got ignored in the Development enviroment, but were rightfully enforced in the Production enviroment.


(I just rediscovered this topic and wanted to add the solution for people that might get here via search)

Good info, thanks for the followup.