ios - 使用 watchOS 3 时出现 CloudKit 错误

标签 ios swift ios-simulator watchkit cloudkit

我相信我已经设置好了一切,并且一切都适用于 iOS 模拟器中的 CloudKit,但是我无法让 CloudKit 在 watch 模拟器:“无法发送有效签名”

有人知道为什么会这样吗?

  • 我知道 CloudKit 根据 Apple“iCloud 交互”在 watchOS 3 中工作。 从 watchOS 3 开始,WatchKit 扩展可以进行通信 直接使用 CloudKit 和其他 iCloud 技术。”

  • 我已经完成了“设置”>“iCloud”,然后使用您的 Apple ID 登录
    根据 enter link description here 在 iOS 模拟器上

  • 在 Watch Extension 中,我根据 enter link description here 使用 CKContainer(identifier:"iCloud.com.xx.xx") 调用 CloudKit

  • 我仔细检查了 Apple 的文档以确保我没有遗漏任何内容:
    enter link description here

  • 我在 watch 上访问的是同一个 CloudKit 容器
    iOS,所以访问 CloudKit

  • 中的数据没有问题
  • 具有容器标识符的 CloudKit 功能已设置 正确地在 Watch Target 中

最佳答案

According to Apple :

CloudKit usage is blocked on watchOS Simulators. Running any test will throw a “Not Authenticated” error even though you are signed in via the paired iOS Simulator. Workaround: Use CloudKit on paired devices with watchOS 3 and iOS 10.

这是来自 watchOS 3 发行说明,但似乎尚未修复。只需在真正的 watch 上进行测试,一切都会正常工作。

关于ios - 使用 watchOS 3 时出现 CloudKit 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41253820/

相关文章:

iOS - 从其他应用程序获取数据,两者之间的通信

c# - Xamarin Forms 如何制作全局工具栏?

ios - 使用 DispatchQueue 索引超出范围异常

ios - SwiftUI - @Binding :String from DatePickerView

ios - swift - 错误 'Expected ' ,' separator' 和 'Expected expression in list of expressions'

arrays - 在 3d 数组中添加 2d 数组 Swift

swift - 配置 Interface Builder 的新 WKWebView 对象

ios - 我可以下载适用于 Xcode 11 beta 5 的 iOS 13 beta 6 模拟器吗?

xcode - Flipper React Native Xcode iOS 模拟器版本不匹配

ipad - 在 iPad 模拟器中调试 Web 应用程序