I have been struggling to get my iOS app to enable iCloud.
I have followed documentation and have switched on iCloud with CloudKit in my project in Xcode.
But, when I then upload the app to App Store Connect from Xcode, iCloud is not there. It does not show up under "Capabilities" and in using the app through TestFlight, iCloud is not enabled.
Is there something special I need to do? Using Xcode version 10.1 + Mac OS High Sierra 10.13.
Note: there is a bunch of detail below. If you want to skip the detail, the summary is that I have followed the straight forward route to enabling iCloud, but it is not yet showing up in App Store Connect or on device through TestFlight.
Steps:
I have followed documentation and tried a few solutions like here and here.
1) I open my project in xcode.
2) In the xcode Capabilities pane, I switch on iCloud, check CloudKit, and use default container (a container named: "iCloud.com.[bundle identifier]").
3) At developer.apple.com, I verify that the app Id I am using has automatically enabled iCloud and CloudKit (it shows as green there).
4) At developer.apple.com, create a provisioning profile using that app id. iCloud is listed among the "Enabled Services" for this profile.
5) Back in xcode, in the General pane, turn off automatically manage signing and select this provisioning profile. If I select "automatically manage signing", it uses an "iPhone Developer" account for the signing certificate, which seems incorrect; when I do manual signing and select the updated prov profile, the Signing Certificate correctly reads "Iphone Distribution: [team name]"
6) Archive app: product -> archive. (I have double-checked here that iCloud remains selected in the Capabilities pane, without error)
7) Upload app: window -> organizer -> select archive, click distribute app, and take it from there.
Result: Build gets uploaded to App Store Connect successfully, but no iCloud support anywhere to be seen.
What else do I need to do?
NOTES:
When I archive the app, the entitlements file (listed under AppName -> AppName -> AppName.entitlements), includes this:
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudKit</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
</dict>
</plist>
The aps-environment says "development". I have tried archiving and uploading this way, and it hasn't worked to enable icloud in App Store Connect. I have also tried manually switching this to "production" and archiving/uploading--but the result was the same there too.
--The underlying app is made with Nativescript, but I don't think that should matter for this stage, as I am uploading through xcode. (I have already gone through Nativescript info on this.)
--when I go into cloudkit dashboard, the Container says "in development". I haven't seen a way to change that without error