I have built a CloudKit app with a rather complex record graph to prove our MVP with our customers. Development has been next to flawless and every problem could easily be derived to crappy code.
Now we've deployed our first version of the app. The review process was Kafka like with the review team being unable to login to cloudkit. I had to use the life line of one of our AppleTS questions to get a checklist for the review team to follow (which basically said - log out and login with another iCloud account if the one you are using doesn't work).
We got through the review process and the app is live on the AppStore. But now the real mess starts on my part. I need to fix a couple of bugs but now I cannot access the app if it is built with my debug settings. As a matter of fact there doesn't seem to be any way I can build and run (and get access, aka login, to CloudKit dev environment).
I've found some obscure references on the net talking about setting up my dev and prod environments correctly, but as far as I know I've simply followed the book, and the Apple Docs on Design Tips for CloudKit simply doesn't solve the problem.
In short! How do I manage a Dev environment and a Prod environment in CloudKit after release, and how do I access Dev environment from a build by XCode sent to my device, to continue development after release?
Edit: Realizing that my Question was not clear enough, here comes an attempt to clairify
I can build and run from XCode. When trying to login to iCloud using
self.container.requestApplicationPermission(CKApplicationPermissions.UserDiscoverability) {...}
I get a
CKApplicationPermissionStatus.Denied
status back. No error, just simply a denied state back. Looking at Settings->iCloud->iCloud Drive-> "Look me up by Email" I sometimes find my switch for my app enabled, and sometimes disabled. Trying to switch the switch crashes the Settings app. Even going to www.icloud.com and setting my discoverability settings for my app does not remedy the problem. Reinstalling the app from App Store or Testflight works like a charm, but of course runs towards to Prod environment.
So the question remains; How do I manage my Dev and Prod environments in such a way that I can access (login to, if you like) my Dev environment when developing, while I have an app for sale in the AppStore or production builds in TestFlight for beta testing.
答案 0 :(得分:2)
几天前,我在这个问题上也被困住了。我完全同意@ adamsde1在我面前写的所有内容,但我想分享自己的所作所为。
因此,首先,我构建了一个具有CloudKit功能的应用程序。这很简单,只是所有应用程序用户(公共数据库)可以共享和编辑的对象数组。假设您知道该怎么做,让我们继续讨论这个问题。
据我了解,有两种类型的数据库开发和生产。开发(用于猜测)用于TestFlight和AppStore版本的开发和生产。
要将应用程序从“开发”切换到“生产”,请转到“项目导航器”中的“权利”并添加com.apple.developer.icloud-container-environment
行并将其String值设置为Production
。另外,在APS Environment
行中,您还需要将String值设置为production
。
下一步将在AppStore Connect上修改数据库。当您进入仪表板时,转到“容器”并按小齿轮,然后选择Deploy Schema to Production...
当应用程序无法在TestFlight上运行时,这解决了我的问题,但是从Xcode部署时一切都很好。希望这也会对某人有所帮助