Programmatically change an array of linked contacts in ABAddressBook, ABPersonCopyArrayOfAllLinkedPeople

Is it possible to programmatically add / remove contacts inside CFArray returned by ABPersonCopyArrayOfAllLinkedPeople , thereby effectively linking and not linking different contact records from different sources to show how “unified” the iOS phonebook is?

+6
source share
1 answer

As far as I was able to determine, there is no public API open for binding or opening contacts, at least in the iOS 6 SDK. However, it looks like you can create links between contacts by calling the undocumented private function bool ABPersonLinkPerson(ABRecordRef from, ABRecordRef to) . This signature may not be entirely correct - I have not tested it too carefully.

Your application, of course, is unlikely to be approved if you use private APIs, but if you are trying to, say, create a fake address book for unit testing and you need some related contacts, this can be useful.

+2
source

Source: https://habr.com/ru/post/889437/


All Articles