Programmatically change linked contacts array in ABAddressBook, ABPersonCopyArrayOfAllLinkedPeople
Asked Answered
M

1

6

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?

Mothering answered 31/5, 2011 at 10:57 Comment(1)
If you have the same question about the more recent CNContact API, you can check out this question: #30944565Dicker
K
2

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.

Karolyn answered 28/11, 2012 at 0:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.