0

I want to get a contact's image from iOS AddressBook with:

NSData *contactImageData = ABPersonCopyImageData(person);

This works fine for local images but not for images synced with Facebook. How can I get these images? Do I have to load them manually from Facebook?

Dennis
  • 362
  • 4
  • 13

1 Answers1

1

You need to get the linked contacts using ABPersonCopyArrayOfAllLinkedPeople() — one of these will be the contact that was synced from Facebook, and you can get the image from that.

Unfortunately I am not aware of any way to determine which one of the linked contacts is from Facebook, so there's no reliable way to specifically get the Facebook contact image — you just have to get the first image you find, or whatever makes sense in your particular case.

hasseg
  • 6,787
  • 37
  • 41