0

I'm developing an app that has to retrieve all the contacts from the Address Book and display them according to the source (Gmail, iCloud, Outlook, Facebook ecc). I've already looked up all similar previous answer on this topic: has anybody found an answer?

Is it possible to discriminate between these sources (for example using mail addresses)?

Using kABSourceTypeProperty and kABSourceNameProperty seems not effective because two Gmail accounts will have same name and same type.

Furthermore is there a way to have a more significant name? For now I have only names like this:

 - name = "" (empty string) for Facebook contacts
 - name = "Card" for iCloud contacts
 - name = "Address Book" for Gmail contacts
 - name = nil for Local Address Book, etc
Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121

1 Answers1

1

If someone else is still stuck with this problem i found a trick solution for the sources of type kABSourceTypeCardDAV (such as Gmail and Yahoo accounts).

The trick is to access the kABPersonLastNameProperty of the ABRecordRef of the source even if it should be a ABPerson-only property. The result is a path (I think where the contacts are stored in the phone) that contains also the mail/name of the account.

Still no idea how to get the name of the account in the kABSourceTypeExchange case!