I have an app that I signed and distribute between some internal testflight users. Potentially I want to invite some 'Public' beta testers which don't need to validate (_World have read rights in the public database)
Question: Do I need to have a working public CloudKit , when users are invited through TestFlight, or are they going to test on the development container?
I understand that when I invite beta-tester without authorization (external testers) they cannot access the developer container, so therefore I need to have the production CloudKit container up and running.
I have tried to populate the public production container, but for whatever reason my upload app still goes to the development container. I have archived the app, and tried, but no luck. I let xcode manage my certificates/profiles. but what do I need to change to be able to use my upload file to upload the production container, instead of the development.
I tried: init() { container = CKContainer(identifier: "iCloud.com.xxxx.xxxx") publicDB = container.publicCloudDatabase
I got no error in the console, but data is always populated to the development database, instead the production.
I tried to create a provisioning profile, but for some reason Xcode doesn't like it. Tried to create one a different provisioning profile manual through the developer portal, for the app. but xcode doesn't want to use that, and mentions that the requirement are already in place.
What can I check/do to solve this.
CloudKit uses your app’s com.apple.developer.icloud-container-environment
entitlement to discover whether you’re using a Development
or Production
version of your provisioning profile, as documented in Testing Your Code Using the Development Container.
Apps running on simulators use the Development
environment; apps running on a device with Xcode by default use the Development
environment as well. If that is the way you run your app to populate the data, the data will go to the the Development
environment.
TestFlight and App Store apps by default use the Production
environment, and so I am wondering if you unintentionally change the entitlement to have your app use the Development
environment. You can verify by running the following command line:
$ codesign -d --ent :- <the path of your app’s binary>
The output should contain something like this:
<key>aps-environment</key>
<string>production</string>
If you see that the value of the key is development
, that will explain why your app writes to the Development
environment, and you can double check if you changed the CloudKit environment setting in the app submission process
Best,
——
Ziqiao Chen
Worldwide Developer Relations.