Detect what was changed from ABAddressBookRegisterExternalChangeCallback

后端 未结 4 1340
暗喜
暗喜 2020-12-01 09:53

I am using ABAddressBookRegisterExternalChangeCallback to get the external changes in AddressbookBook of the user. I am using the following code to register the callback:

4条回答
  •  余生分开走
    2020-12-01 10:34

    During the first time, I am dumping all the data in local database using sqlite, then on external change I am dumping new data from contacts database in dummy db in sqlite, then firing big long compare query based on what has changed. In our case, main focus was on phone numbers and name. Once you get change update that in your contacts db in sqlite. I think even whatsapp is doing something similar. I checked the time taken to reflect the changes by whatsapp and our app almost are similar. Actually, my app is 2 secs faster than whatsapp in terms of reflecting changes. Hope this will help.

提交回复
热议问题