discoverAllIdentities&从iOS 10.3开始,discoverUserIdentity为CKUserIdentity.lookupInfo返回nil [英] discoverAllIdentities & discoverUserIdentity returning nil for CKUserIdentity.lookupInfo as of iOS 10.3

查看:101
本文介绍了discoverAllIdentities&从iOS 10.3开始,discoverUserIdentity为CKUserIdentity.lookupInfo返回nil的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CKContainer.discoverAllIdentities(completionHandler :),discoverUserIdentity(recordID:-完成处理程序返回CKUserIdentity,但即使联系人包含电子邮件,电话等,.lookupInfo始终为零。hasiCloudAccount,userRecordID,nameComponents等其他属性很好。刚开始发生在最近的Swift 3.1发行版中。有人知道这是否是预期的行为,因为我无法在发行说明中找到对CloudKit更改的任何引用,但这看起来像是一件隐私事。

CKContainer.discoverAllIdentities(completionHandler:), discoverUserIdentity(recordID: - completion handler returns CKUserIdentity but .lookupInfo is always nil even when contacts contain email, phone, etc. Other properties such as hasiCloudAccount, userRecordID, nameComponents are fine. This issue just started happening with recent Swift 3.1 release. Does anyone know if this is intended behavior as I have not been able to find any reference to CloudKit changes in release notes but this is looking like a privacy thing.

经过进一步调查,似乎此问题可能是由于最近的iOS 10.3更新造成的。在具有10.2.1的iPhone 5上运行该应用程序时,该问题不会发生,并且lookupInfo正确包含emailAddress

After further investigation, it appears that this issue might be due to the recent iOS 10.3 update. When running the app on an iPhone 5 with 10.2.1 the problem does not occur and lookupInfo properly contains emailAddress

已提交的Apple bug:31377433

Submitted Apple bug: 31377433

新:此外,如果我尝试通过CKDiscoverAllUserIdentitiesOperation访问信息,尤其是userIdentityDiscoveredBlock -> user.nameComponents结果我与未满12岁(并可能在家庭共享计划中)的用户相关联的Apple ID的空字符串。我没有找到有关此信息,并且Apple开发支持也没有提供帮助。

NEW: In addition, if I try to access information via CKDiscoverAllUserIdentitiesOperation, in particular userIdentityDiscoveredBlock -> user.nameComponents the result is "empty string" for apple id's associated with users who are under 12 years old (and potentially on the "Family Sharing" plan). I've found no information about this and apple dev support offered no help either.

推荐答案

因为我无法发表评论由于缺少声誉,我必须采用这种方式...

Since I can´t put a comment because of missing reputation, I have to do it this way...

我也提交了相同的错误(31397767),希望他们能够解决它。

I also submitted the same bug (31397767) and hope they will fix it.

对于 CKFetchShareParticipantsOperation ,必须具有 CKUserIdentityLookupInfo 。由于没有解决方法,我们需要等待他们修复它。

For CKFetchShareParticipantsOperation it is necessary to have CKUserIdentityLookupInfo. Since there is no workaround we need to wait for them to fix it.

我只是对这个错误感到好奇,因为如果您已经将应用程序提交给应用商店,整个共享部分对用户不起作用。

I'm just curious about this bug because if you already submitted your app to the app store the whole sharing part would not work for the users.

更新

iOS 10.3 .1更新无法解决问题。

iOS 10.3.1 update didn't solve the issue.

更新:解决方案

我收到了苹果公司对此事的回应。这是答案c& p:

I got a response from Apple about this "issue". Here is the answer c&p:


这是预期的行为,因为
CKDiscoverAllUserIdentitiesOperation不需要提示
个用户用于联系人访问。如果您想将这些结果变成
个参与者,则需要请求联系人访问权限,并通过contactIdentifiers属性自己从联系人中获取
个查询信息。

This is the expected behavior, since CKDiscoverAllUserIdentitiesOperation doesn't require prompting the user for Contacts access. If you'd like to turn these results into participants you'll need to request contacts access and get the lookup info off the contacts yourself via the contactIdentifiers property.

//通过CKDiscoverAllUserIdentitiesOperation
发现的标识对应于本地Contacts数据库中的条目。这些
身份将填写contactIdentifiers,您的应用可能会用
来获取有关被发现
的联系人的更多信息。对于单个发现的
用户,可能存在多个contactIdentifier,因为多个联系人可能包含相同的电子邮件
地址或电话号码。

// Identities discovered via CKDiscoverAllUserIdentitiesOperation correspond to entries in the local Contacts database. These identities will have contactIdentifiers filled out, which your app may use to get additional information about the contacts that were discovered. Multiple contactIdentifiers may exist for a single discovered user, as multiple contacts may contain the same email addresses or phone numbers.

请注意,发现用户和查找参与者是两个在逻辑上不同的
事物-您只能通过-[CKContainer
requestApplicationPermission:CKApplicationPermissionUserDiscoverability
...]来发现使
本身可被发现的用户,但是您可以让参与者获得任何电子邮件地址或电话
号码,即使该号码与iCloud帐户不对应。您不需要
来发现用户然后将其变成参与者-您可以
只是让应用程序的用户输入参与者的地址即可将
添加到共享中。

Note that discovering users and looking up participants are two logically different things- you can only discover users that have made themselves discoverable via -[CKContainer requestApplicationPermission:CKApplicationPermissionUserDiscoverability ...], but you can get a participant for any email address or phone number even if it doesn't correspond to an iCloud account. You don't need to discover users and then turn them into participants- you can just have the user of your app enter addresses for participants to add to a share.

这篇关于discoverAllIdentities&从iOS 10.3开始,discoverUserIdentity为CKUserIdentity.lookupInfo返回nil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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