简体   繁体   English

核心数据和 iCloud 同步在实时应用程序中不起作用

[英]Core data and iCloud sync not working in live App

Just finished and app that uses core data and iCloud sync.刚刚完成并使用核心数据和 iCloud 同步的应用程序。 The app is just working fine while testing on the simulator and on devices: adding text and images to the persistent store without problems, all data is restored and all devices: on the simulator and real iPhones.该应用程序在模拟器和设备上测试时运行良好:将文本和图像添加到持久存储中没有问题,所有数据都被恢复,所有设备:在模拟器和真实的 iPhone 上。 I did a lot of tests like deleting the App from the phone and simulators and the data persists every time I reinstall/run the App.我做了很多测试,比如从手机和模拟器中删除应用程序,每次我重新安装/运行应用程序时数据仍然存在。

Now the App is "live" in the App store but the data is not syncing between devices.现在该应用程序在应用程序商店中“上线”,但数据未在设备之间同步。 I have installed on two iPhones using the same Apple username/ID, added records on both devices and the data is not restored or duplicated on each phone as expected.我已使用相同的 Apple 用户名/ID 在两部 iPhone 上安装,在两部设备上都添加了记录,但数据并未按预期在每部手机上恢复或复制。

Any ideas?有任何想法吗?

I did not know that, but once the App is approved, we need to deploy the schema to production, otherwise Cloudkit will not go live.我不知道,但是一旦 App 获得批准,我们需要将架构部署到生产中,否则 Cloudkit 将无法上线。

To do so, go to icloud.developer.apple.com, on your dashboard, click on the gear icon and "Deploy Schema to Production".为此,请转到 icloud.developer.apple.com,在您的仪表板上,单击齿轮图标和“将架构部署到生产”。

在此处输入图片说明

Hope this helps others with the same dilema ;)希望这可以帮助其他有同样困境的人;)

您还需要将权利文件中的com.apple.developer.icloud-container-environment密钥设置为“生产”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM