Dealing with duplicate contacts due to linked cards in iOS' Address Book API

前端 未结 5 1997
挽巷
挽巷 2020-12-12 14:19

Some beta-users of my upcoming app are reporting that the list of contacts contain a lot of duplicate records. I\'m using the result from ABAddressBookCopyArrayOfAllPeople a

5条回答
  •  既然无缘
    2020-12-12 15:11

    The approach that @Daniel Amitay provided contained nuggets of great value, but unfortunately the code is not ready for use. Having a good search on the contacts is crucial to my and many apps, so I spent quite a bit of time getting this right, while on the side also addressing the issue of iOS 5 and 6 compatible address book access (handling user access via blocks). It solves both the many linked cards due to incorrectly synched sources and the cards from the newly added Facebook integration.

    The library I wrote uses an in-memory (optionally on-disk) Core Data store to cache the address book record ID's, providing an easy background-threaded search algorithm that returns unified address book cards.

    The source is available on a github repository of mine, which is a CocoaPods pod:

    pod 'EEEUnifiedAddressBook'
    

提交回复
热议问题