iCloud已在Xcode中打开,但未与应用商店连接.怎么修? [英] iCloud turned on in Xcode, but not app store connect. How to fix?

查看:109
本文介绍了iCloud已在Xcode中打开,但未与应用商店连接.怎么修?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力获取iOS应用程序以启用iCloud.

I have been struggling to get my iOS app to enable iCloud.

我已遵循文档,并在Xcode的项目中使用CloudKit打开了iCloud.

I have followed documentation and have switched on iCloud with CloudKit in my project in Xcode.

但是,当我随后将应用程序从Xcode上传到App Store Connect时,iCloud不存在.它不会显示在功能"下,并且在通过TestFlight使用该应用程序时,未启用iCloud.

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.

我需要做些特别的事情吗?使用Xcode版本10.1 + Mac OS High Sierra 10.13.

Is there something special I need to do? Using Xcode version 10.1 + Mac OS High Sierra 10.13.

注意:下面有很多细节.如果您想跳过细节,摘要是我遵循了直接启用iCloud的方法,但尚未显示在App Store Connect或通过TestFlight的设备上.

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.

步骤:

我已遵循文档并尝试了一些解决方案,例如此处和<.

I have followed documentation and tried a few solutions like here and here.

1)我用xcode打开项目.

1) I open my project in xcode.

2)在"xcode功能"窗格中,打开iCloud,检查CloudKit,并使用默认容器(名为"iCloud.com.[bundle identifier]"的容器).

2) In the xcode Capabilities pane, I switch on iCloud, check CloudKit, and use default container (a container named: "iCloud.com.[bundle identifier]").

3)在developer.apple.com上,我验证我正在使用的应用程序ID是否已自动启用iCloud和CloudKit(在此处显示为绿色).

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)在developer.apple.com上,使用该应用程序ID创建一个配置文件.该配置文件的已启用服务"中列出了iCloud.

4) At developer.apple.com, create a provisioning profile using that app id. iCloud is listed among the "Enabled Services" for this profile.

5)返回xcode,在常规"窗格中,关闭自动管理签名"并选择此配置文件.如果我选择自动管理签名",它将使用"iPhone Developer"帐户作为签名证书,这似乎是不正确的.当我进行手动签名并选择更新的prov配置文件时,签名证书正确显示为"Iphone分配:[团队名称]"

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)存档应用:产品->存档. (我在这里再次检查了iCloud仍在功能"窗格中保持选中状态,没有错误)

6) Archive app: product -> archive. (I have double-checked here that iCloud remains selected in the Capabilities pane, without error)

7)上传应用程序:窗口->组织者->选择存档,单击分发应用程序,然后从那里获取.

7) Upload app: window -> organizer -> select archive, click distribute app, and take it from there.

结果:内部版本成功上传到App Store Connect,但是看不到iCloud支持.

Result: Build gets uploaded to App Store Connect successfully, but no iCloud support anywhere to be seen.

我还需要做什么?

注意:

我存档应用程序时,权利文件(在AppName-> AppName-> AppName.entitlements下列出)包括以下内容:

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>

aps环境说发展".我已经尝试过以这种方式进行归档和上传,但是在App Store Connect中启用icloud并没有奏效.我还尝试过手动将其切换为生产"并进行归档/上传-但结果在那里也相同.

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.

-底层应用程序是用Nativescript制作的,但是我认为这对本阶段不重要,因为我是通过xcode上传的. (我已经了解了有关Nativescript的信息.)

--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.)

-当我进入cloudkit仪表板时,Container表示正在开发中".我还没有找到一种可以毫无错误地更改它的方法

--when I go into cloudkit dashboard, the Container says "in development". I haven't seen a way to change that without error

推荐答案

在这里,我已经弄清了一个基本问题:我混淆了两种基本的iCloud(或者至少两种非常不同的使用iCloud的方式)开发人员).

I've figured out the essential issue here: I was confusing what is, basically, two different iClouds (or at least two very different ways to use iCloud as a developer).

这对于许多熟悉iOS编程的大多数人来说都是显而易见的,但这是我不了解的关键点.

This will be obvious to many/most people familiar with iOS programming, but it was the key point I did not grasp.

在没有这些信息的情况下,我被一些人甩开了,说iCloud只是自动工作",而另一些人则对需要进行配置的问题进行了深入探讨.他们俩都是对的,只是在谈论不同的事情.

Without this information, I was thrown off by some people saying iCloud just "automatically works", while others would go into depth about the need to do configuration. They both were right--just talking about different things.

因此,这是我之前没有了解的:从开发人员的角度来看,这是iCloud的两种不同用法:

So this is what I did not grasp before: These are the two different uses of iCloud from the developer perspective:

1)自动备份iCloud .这是系统范围的功能,允许用户从其设备备份数据.用户通过打开"iCloud Backup"(设置->苹果ID-> iCloud)将其打开.开启后,设备会自动定期备份用户数据.此功能将自动从app/Documents目录中包含的应用程序中备份数据.进一步的信息此处.

1) Automatic, backup iCloud. This is the system-wide feature, that allows users to back up data from their device. Users turn it on through turning on "iCloud Backup" (settings --> apple id --> iCloud). Once on, the device automatically backs up the user's data regularly. This feature will automatically back up data from your app that is included in the app/Documents directory. Further info here.

请参阅此处,以了解防止某些数据从如果需要的话,可以备份.

See here for details on preventing certain data from being backed up if you want.

作为应用程序开发人员,除了将需要备份的数据放入系统中的完整文件并备份到Document Director中之外,您无需执行任何其他操作.您甚至不需要通过Xcode启用iCloud(我认为-尽管我错了,但其他人请纠正我).

Other than putting data you want backed up in the system wide back up in the documents director, there is nothing you as an app developer need to do. You do not even need to enable iCloud through Xcode (I think--though others please correct me if I am wrong).

在加载应用程序时,这不会将数据从iCloud加载到您的应用程序中.相反,它保存了(您的应用程序数据和用户手机上的其他数据的)备份-其主要好处是,如果用户丢失了设备,他们可以在其他设备上恢复该数据.

This will not load data from iCloud onto your app when the app is loaded. Rather, it saves a backup (of your app data and the other data on the user's phone)--the main benefit of which is that if the user loses their device they can recover that data on a different device.

2)通过iCloud特定于应用程序的云存储.当然,这不会自动发生,需要进行有意义的配置.

2) App specific cloud storage through iCloud. This affirmatively does not happen automatically, and requires meaningful configuration.

在这里您可以像后端云解决方案一样使用iCloud.例如,您可以在创建特定数据时将特定数据发送到iCloud,然后在用户加载应用程序时将其从iCloud数据获取到应用程序中(而不是将数据本地存储在用户设备上).

This is where you can use iCloud like a backend cloud solution. For example, you can send specific data to iCloud when that data is created, and then later get that data from iCloud onto the app when the user loads the app (instead of storing that data locally on the user's device).

这是CloudKit出现的地方.

This is where CloudKit comes in.

要启用此功能,您需要生成适当的权利文件-例如在Xcode上启用带CloudKit的iCloud,并确保应用程序ID和预配配置文件确认已启用CloudKit.有关更多详细信息,请参阅问题中的步骤1至7.这应该使事情启用".

To enable this, you need to generate the proper entitlements file--such as enabling iCloud w/ CloudKit on Xcode, and being sure the app id and provisioning profile confirm that CloudKit is enabled. For a bit more detail, see my steps 1 through 7 in my question. This should work to get things "enabled".

但这只是第一步,然后您需要对事情进行配置".为此,您可能必须对CloudKit为您的应用程序生成的容器进行一些配置,并在应用程序中添加特定于后端流程的代码.在先前答案中链接的教程中有一些不错的信息.

But that is just the first piece, you then need to get things "configured". To do this, you likely have to do some configuration of the container that CloudKit generates for your app, and add code specific to the backend process in your app. There is some good info in the tutorial linked in the prior answer.

感谢提供此信息的人员,包括Apple开发人员技术支持.

Thanks to those who gave info on this, including Apple Developer Technical Support.

这篇关于iCloud已在Xcode中打开,但未与应用商店连接.怎么修?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆