Contacts Synchronisation in iOS application

I am working on an application in which I need to keep contacts synchronisation within the application like in viber and whatsapp application. When a new user installed the application, all his/her contacts who are already using the application will get notified like in viber.Can anyone guide me with any documentation link or sample application on how the application will efficiently synchronise contacts when the application is in background, when a new contact is added in phone book.

Upvotes: 2

Views: 667

Answers (1)

Bhumeshwer katre
Bhumeshwer katre

Reputation: 4671

Register your app for addressBook changed Callback:

ABAddressBookRef addressBook = ABAddressBookCreate();
ABAddressBookRegisterExternalChangeCallback(addressBook, addressBookChanged, nil);

And implement it:

void addressBookChanged(ABAddressBookRef abRef, CFDictionaryRef dicRef, void *context) {

    NSLog(@"!!!!!Address Book Changed!");

}

There is no such API available which notify you which record has been updated or added or deleted. You need to create your own logic to achieve it.

Upvotes: 1

Related Questions