I have read and tried all the possible solutions available online, but still didn't get a result.
My multi-platform iOS/macOS app uses private databases in iCloud with Core Data. All works as expected when I build the app from Xcode to my multiple devices: data is being synced. But when I upload the app to TestFlight, data is not being synced.
This is what I have already tried:
-
In CloudKit Dashboard, I reset the schema and deployed schema changes from the development to production.
-
In Xcode project settings, in Targets, under Frameworks, Libraries... I added the CloudKit.framework, set as "do not embed".
-
In Xcode project settings, under Signing & Capabilities, all the CloudKit, Background fetch and Remote notifications checkboxes are enabled for both Debug and Release. They all point to the same correct iCloud container.
-
In Xcode project settings, under Build Settings, Code Signing Entitlements for both Debug and Release point to the same entitlements file.
-
In .entitlements file, CloudKit container identifier points to the correct container. iCloud Services set to CloudKit.
-
In .entitlements file, APS Environment for both iOS and macOS is set as "production".
-
In Core Data .xcdatamodeld file, under Configurations, I have a Default option, and it is being set to "Used with CloudKit."
-
Each time I upload new version to the TestFlight, I delete all the previous versions from all my devices, so development and production containers are not mixed up in any way.
I understand that I may be missing something. But after researching all the resources available online, I didn't find anything else to configure or to add in this setup. I want to point out again that data is not being synced only in TestFlight, and thus, possibly, after release. Whenever I build app directly to the device from Xcode, all works as expected.
I hope someone can help me.