CNContactStoreDidChangeNotification fired multiple times

When a contact gets changed CNContactStoreDidChangeNotification is fired multiple times for just adding a phone number to an existing contact.


Questions:

  1. Why is CNContactStoreDidChangeNotification fired multiple times ?
  2. CNContactStoreDidChangeNotification doesn't contain any details about the Contact Identifiers changed. Am I missing something ? As a result of the this I am relaoding all the contacts / groups every time the notification is fired.
  3. Is there a better way to handle this ?

Replies

Any update on this?


I'm having the exact same issue; I have the notification fired twice (it's only registered once, I'm sure). If I query the contacts on the first fire I get back the original results, and if I query the contacts on the second notification firing then I find the updated contact (in the list of all contacts). Should the notification give some indication of what has changed?


Are we supposed to just query all of the contacts every time? I end up with some bool logic to just ignore the first notification fire, but that is terrible code that will break if this behaviour changes in the future.


Thanks

Same problem here, in iOS 10.3.1


I tested it in the simulator and there the call happens once, but in real device the call for CNContactStoreDidChangeNotification happens twice even though the NSNotification is added once , in a dispatch_once() block.