0

I requires Address book synchronisation whenever new contact adds.

Like:WhatsApp Like Listing of all the contacts who are available on the App. When New contact has been added , How to compare with others contacts ? I want to highlight New contacts which are added newly.

Mohit Jethwa
  • 613
  • 2
  • 6
  • 14

1 Answers1

0

For IOS8, While fetching addressbook ,declare callback method like this ,

 ABAddressBookRef book = ABAddressBookCreate();
 ABAddressBookRegisterExternalChangeCallback(book,MyAddressBookExternalChangeCallback, (__bridge void *)(self));

And you will be notified through this method,

void MyAddressBookExternalChangeCallback (
                                      ABAddressBookRef addressBok,
                                      CFDictionaryRef info,
                                      void *context
                                      )
{

} 

For IOS9, Use this notification while fetching contacts through CNcontact ,

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(CNcontactDidChange:) name:CNContactStoreDidChangeNotification object:nil];
Vijay Karthik
  • 457
  • 4
  • 6