以编程方式更改 ABAddressBook、ABPersonCopyArrayOfAllLinkedPeople 中的链接联系人数组

发布于 2024-11-10 11:54:00 字数 139 浏览 9 评论 0原文

是否可以通过编程方式添加/删除 ABPersonCopyArrayOfAllLinkedPeople 返回的 CFArray 内的联系人,从而有效地链接和取消链接来自不同来源的不同联系人记录,以在 iOs 电话簿中显示为“统一”?

Can one programmatically add/remove the contacts inside the CFArray returned by ABPersonCopyArrayOfAllLinkedPeople, thus, effectively, linking and un-linking different records of contacts from various sources to show as "unified" in the iOs phone book?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看海 2024-11-17 11:54:00

据我所知,至少在 iOS 6 SDK 中,没有公开用于链接或取消链接联系人的公共 API。但是,您似乎可以通过调用未记录的私有函数 bool ABPersonLinkPerson(ABRecordRef from, ABRecordRef to) 在联系人之间创建链接。这个签名可能不完全正确——我还没有对此进行彻底的测试。

如果您使用私有 API,您的应用程序当然不太可能获得批准,但如果您试图为了单元测试而制作一个假地址簿,并且您想要其中包含一些链接的联系人,则这可能是有用。

As far as I've been able to determine, there is no public API exposed for linking or unlinking contacts, at least in the iOS 6 SDK. However, it does appear that you can create links between contacts by calling the undocumented, private function bool ABPersonLinkPerson(ABRecordRef from, ABRecordRef to). That signature may not be exactly right--I haven't tested this too thoroughly.

Your app is of course unlikely to be approved if you make use of private APIs, but if you're trying to, say, make a fake address book for the sake of unit testing and you want some linked contacts in that, this could be useful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文