问题标签 [ckshare]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
1026 浏览

cloudkit - CloudKit CKShare userDidAcceptCloudKitShareWith 在 Mac 应用上从不触发

我正在努力CKShare在 Swift 4 的 macOS 应用程序中接受 a。我已经完成了以下所有操作:

  • 创建CKShare并将其保存rootRecord到 CloudKit
  • 添加参与者 ( CKShare.Participant)
  • 我已经确认它CKShare在 CloudKit 服务器上,并且我邀请的人可以访问它。这是截图:https ://d.pr/i/0sMFQq

当我单击与 关联的共享链接时CKShare,它会打开我的应用程序,但没有任何反应并且userDidAcceptCloudKitShareWith不会触发。

我必须在 info.plist 中包含某种 URL 方案吗?或者也许是我需要在我的NSApplicationDelegate代表中遵守的协议?对于我的一生,我无法弄清楚该怎么做。提前致谢!

更新

我已经尝试了更多的东西。当我在网络浏览器中打开共享链接时,我看到:

在此处输入图像描述

单击“确定”会使屏幕逐渐消失:

没有什么

不是特别有帮助。:) 这样做之后,参与者在 CloudKit 中的状态仍然是Invited,所以共享仍然没有被接受。

当我单击消息中的共享链接时,我会看到如下弹出窗口: CloudKit 分享弹窗 单击打开后,我的应用程序的新副本出现在 Dock 中,然后应用程序突然关闭。崩溃日志指出:

由于未捕获的异常“CKException”而终止应用程序,原因:“应用程序缺少必需的权利 com.apple.developer.icloud-services”

我尝试在 Xcode 的 Capabilities 部分中关闭再打开 iCloud,但没有任何变化。我知道这个例外是不对的,因为我可以正常启动我的应用程序并整天使用 CloudKit。只有CKShare导致此崩溃的原因。

这是一团糟。救救我,欧比旺克诺比,你是我唯一的希望。

0 投票
1 回答
237 浏览

xcode - CKShare "userDidAcceptCloudKitShareWith" 仅在首次安装同一用户时触发

在 Appdelegate 我有 userDidAcceptCloudKitShareWith
,但它只被接受邀请的用户的第一台设备触发。

例子:

  • 用户 A 邀请用户 B。
  • 用户 B 在设备 B1 上接受邀请 -> 一切正常,方法被触发,我知道该怎么做。
  • 问题是,当用户 B 使用他的设备 B2 时,该方法不会触发。我应该如何在设备 B2 上知道用户 B已经 接受了邀请?

我在真实设备上进行了尝试,并且只在第一个设备上触发了该方法。

我可以检查他是否有一个带有预期 zoneID 的 sharedZone,但这对我来说听起来有点奇怪 - 任何帮助都非常感激!

0 投票
1 回答
417 浏览

icloud - CloudKit acceptShare error - "Couldn't get a Sharing identity set"

I am programatically creating a CKShare and sharing the URL with recipients over email; when they do this, they click on the link and the UIApplication 'userDidAcceptCloudKitShareWithMetadata' method is correctly called. I then use the CKAcceptSharesOperation to mark the share as 'accepted'.

In most cases, it's working fine, even with the app in production environment. Every now and then, a user messages that they get an error with the CKAcceptSharesOperation .. the error says something like "Couldn't get a Sharing identity set". The error in full:

CKInternalErrorDomain: 5000" UserInfo={NSUnderlyingError=0x281f8f0f0 {Error Domain=CKInternalErrorDomain Code=5000 "Couldn't get a Sharing identity set" UserInfo={CKErrorDescription=Couldn't get a Sharing identity set, NSLocalizedDescription=Couldn't get a Sharing identity set, NSUnderlyingError=0x281f8d8c0 {Error Domain=CKInternalErrorDomain Code=5000 "Couldn't create a PCS identity" UserInfo={CKErrorDescription=Couldn't create a PCS identity, NSLocalizedDescription=Couldn't create a PCS identity, NSUnderlyingError=0x281f8f570 {Error Domain=NSOSStatusErrorDomain Code=-25300 "Failed finding service Sharing" UserInfo=0x2811c1400 (not displayed)}}}}}, CKErrorDescription=Couldn't get a Sharing identity set, warningTitleKey=Accept Share Failed, NSDebugDescription=CKInternalErrorDomain: 5000, NSLocalizedDescription=There was a problem with accepting this share - Couldn't get a Sharing identity set}

I had the user check his/her iCloud account, and it seems fine. The iCloud account is new, so that might have something to do with it? If not, what else could be causing this? What can I try to isolate the issue?

Thanks.

0 投票
3 回答
2865 浏览

ios - 使用 NSPersistentCloudKitContainer 在用户之间共享核心数据

Apple 推出了NSPersistentCloudKitContaineriOS 13,它使我们能够将 CloudKit 与 Core Data 一起使用。我让它在不同的设备上几乎立即工作,但我的主要问题仍然存在。

是否可以与其他用户轻松共享数据?我一直在阅读,CKShare但不知道如何NSPersistentCloudKitContainer以简单的方式实现这一目标。

0 投票
1 回答
84 浏览

ios - CloudKit 共享工作流程结束于:要打开它,您需要最新版本的“app_name”

我正在尝试使用 CloudKit 在一组 CKRecords 上创建 CKShare。我已经完成了大部分工作流程:

  • 创建一个所有共享记录都将标识为父级的“root_record”
  • 添加几条记录并将“root_record”标识为父级
  • 在 'root_record' 上创建 CKShare 并使用 UICloudSharingController 显示共享对话框
  • 包括强制性 itemTitleForCloudSharingController & failedToSaveShareWithError
  • 包括 - (void)application:(UIApplication *)application userDidAcceptCloudKitShareWithMetadata: in appdelegate
  • 单击背景模式>功能中的远程通知

我得到了设备 A 上的共享对话框,按预期将共享文本或通过电子邮件发送到设备 B。在设备 B 上,我得到:

打开“My_Title_String”?> 不是现在 | 打开

但是当我选择“打开”时,我得到:

更新“App_Name”| 分享者分享了这个。要打开它,您需要最新版本的“app_name”。> 前往应用商店 | 现在不要

我已经尝试增加内部版本号,删除应用程序 + 从 TestFlight 重新安装和安装,但我无法让应用程序在设备 B 上调用,所以 - (void)application:(UIApplication*)application userDidAcceptCloudKitShareWithMetadata: 永远不会被调用。

关于我哪里出错的任何建议?

0 投票
3 回答
388 浏览

swift - CKShare - 无法修改某些记录错误 - CloudKit

我正在尝试与其他用户共享记录,CloudKit但我不断收到错误消息。当我点击桌子上的一个项目/记录时UICloudSharingController,我可以看到iMessage应用程序图标,但是当我点击它时,我得到一个错误并且UICloudSharingController消失了,有趣的是即使在错误之后我仍然可以继续使用该应用程序。

这就是我所拥有的。

代码

错误

修改部分记录失败

这是我看到的...

在此处输入图像描述

知道有什么问题吗?

编辑:

顺便说一句,错误是在cloudSharingController failedToSaveShareWithError方法中产生的。

0 投票
2 回答
132 浏览

ios - 用户在接受记录和应用程序启动时无法打开 CKShare 记录

通过实现 CloudKit 的 CKShare 功能以我的方式工作。我已经设法访问该部分以共享记录(例如通过电子邮件),并且还可以确认用户收到了邀请。问题是当用户接受记录时,应用程序会弹出但没有任何反应。为了帮助这里是应用程序的一些关键元素,如果我错了,请告诉我。

1) 该应用程序不需要用户使用他们的 Apple ID 登录

2)当我使用电缆将手机连接到计算机时(又名尚未使用 TestFlight),我正在通过直接构建在两部不同手机(具有单独的 Apple ID)上的应用程序来测试应用程序。

3)我已经在 CloudkitDashboard 中查看,我可以看到已共享的记录,也可以看到已共享的记录,但是我没有看到用户电子邮件,而是我发送了邀请,我看到了我的电子邮件以及记录哈哈的事实被“接受”

4) 我在 Info.plist 文件中添加了 CKSharingSupported 键。

5) AppDelegate.swift 文件中用于接受 CKShare 的代码如下。我希望您注意字符串“User Accepted the Share”永远不会被打印出来,这让我认为这部分代码永远不会运行。

func application(_ application: UIApplication, userDidAcceptCloudKitShareWith cloudKitShareMetadata: CKShare.Metadata) {

任何能指导我哪里错的见解,将不胜感激。

感谢您的时间!

0 投票
0 回答
77 浏览

cloudkit - 无法从共享数据库中获取记录区域

要访问共享,我首先尝试从共享数据库中获取记录区

我没有从共享数据库中获得任何记录区。当我转到 cloudkit 仪表板时,我在共享数据库中看不到任何共享区域。为什么共享 URL 被分类并且 CKShare 工作后共享记录区域不存在?如何使这项工作?

0 投票
1 回答
129 浏览

cloudkit - 无法与 UICloudSharingController 共享;随着“上传”消息消失

在视图顶部显示 UICloudSharingController 时,它会显示屏幕,当我选择消息选项以向我想与之共享的人发送消息时,它会提供一个带有“上传”消息的旋转轮并消失 - 附加截屏

但是,当我转到 cloudkit 仪表板时,根记录已被共享。但我不能与特定的人分享。是因为它已经共享全球了吗?我该如何解决?

0 投票
1 回答
68 浏览

ios - CloudKit:如何使用 CKFetchShareParticipants 和 CKModifyRecords 获取分享 URL?

我正在关注这个WWDC 视频和一些在线找到的示例代码(遗憾的是,Apple 没有在其 WWDC 演讲中包含示例代码),下面的代码我没问题,CKShareParticipant但是这个块modOperation.modifyRecordsCompletionBlock根本没有返回,我在做什么错误的?