简体   繁体   English

ios 应用程序容器与 icloud 同步

[英]ios app containers sync with icloud

I am building an app that contains its own iCloud container.我正在构建一个包含自己的 iCloud 容器的应用程序。 The capabilities configuration is attached below.能力配置附在下面。

Below is the key entry in Info.plist.下面是 Info.plist 中的关键条目。

<key>iCloud.com.dearle.Ascert</key>
<dict>
  <key>NSUbiquitousContainerIsDocumentScopePublic</key>
  <true/>
  <key>NSUbiquitousContainerSupportedFolderLevels</key>
  <string>Any</string>
  <key>NSUbiquitousContainerName</key>
  <string>Ascert</string>
</dict>

It is my understanding that anything I put into my app container should show up in the iCloud drive under a folder named Ascert and that I should be able to open the document in my app from the iCloud drive.我的理解是,我放入应用程序容器的任何内容都应显示在 iCloud 驱动器中名为 Ascert 的文件夹下,并且我应该能够从 iCloud 驱动器打开应用程序中的文档。

I have tried everything I can think of, unfortunately I am not very experienced with xCode so am unsure of where I am going wrong.我已经尝试了我能想到的一切,不幸的是我对 xCode 不是很有经验,所以我不确定我哪里出错了。

Any help would be appreciated.任何帮助,将不胜感激。

I faced the same issue as well, the setup you have done is correct.我也遇到了同样的问题,您所做的设置是正确的。 Try increasing the build number and version number before you run your code for the iCloud functionality.在为 iCloud 功能运行代码之前,尝试增加内部版本号和版本号。 This worked for me.这对我有用。 Apparently as long as these values are not increased the iCloud setup is not picked up显然,只要不增加这些值,就不会选择 iCloud 设置

No, it won't be visible in iCloud drive.不,它不会在 iCloud 驱动器中可见。 It will be in iCloud / Manage Storage/ Container name.它将在 iCloud/管理存储/容器名称中。 To sync files between different devices with same Apple id, you use method startDownloadingUbiquitousItemAtURL.要在具有相同 Apple ID 的不同设备之间同步文件,请使用方法 startDownloadingUbiquitousItemAtURL。 Source 来源

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

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