AddressBook synchronization in iOS
Asked Answered
S

1

23

Is there any way in iOS to get notification about address book changes since the last time applications was opened.

The application stores address book in internal database and I don't want to perform full sync each time it activated.

Thanks in advance.

Small addition to clarify the question: I use ABAddressBookRegisterExternalChangeCallback to observe changes when application suspended to background, but from what I know, this method can't work if application was closed completely and reopened(for example: after phone restart or closed from task list).

Subdominant answered 10/9, 2012 at 9:33 Comment(1)
Hello, did you find any solution for sync problem?Lorielorien
F
3

Maybe you're looking for this:

ABAddressBook Reference - ABAddressBookRegisterExternalChangeCallback

You should register that notification!

Tell me if worked or if you need any help

Mário

Fertile answered 10/9, 2012 at 10:3 Comment(5)
This will work only while application is running(or suspended in bg) and registered to this callback. I want to get notification even if application was closed completely.Subdominant
I was searching for a creation date but I think that doesn't exist. In my opinion the best solution is to revert your data each time that the user starts the app and register a notification if the Address Book was changed while the app is running. More info here: developer.apple.com/library/ios/#DOCUMENTATION/AddressBook/…Betthel
Yeap, I looked for it too, but thought maybe I missed something. Full sync could be painful if iPhone contains 10k addressbook entries.Subdominant
I will save the last sync time.and when open my app,I will check the sync time and the record last modified time ,so I will know after my last sync,which record has been modified. hope this help.Entebbe
But, how can i get last modified time of each record in faster way ? I am stuck with samething #31760363Orlop

© 2022 - 2024 — McMap. All rights reserved.