以编程方式更改 ABAddressBook、ABPersonCopyArrayOfAllLinkedPeople 中的链接联系人数组
是否可以通过编程方式添加/删除 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,至少在 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.