In my app, I want to create a new contact. If a contact with the same name already exists, I want to link the new contact to the old one.
I have looked into the CNContact and CNContactStore references, and don't see any way to link contacts. Is this possible, and if so, how?
Below is the code to merge a contact with the already present contact in contact store.Just an FYI that unique values like given name family name will be replaced and arrays such as numbers, emails, addresses will be appended with the existing values. Cheers!!
In IOS9 contacts in different accounts that represent the same person may be automatically linked together.
To achieve this you should make sure that the name of your newly inserted contact matches the name of the contact you would like to unify with.
The documentation linked below gives the example of "John Appleseed" on iCloud and Facebook.
https://developer.apple.com/library/watchos/documentation/Contacts/Reference/Contacts_Framework/index.html