I am trying to access contacts' Facebook ID via the address book API in iOS. The code works for profiles that I have manually entered into contacts, but it does not return the social profiles of Facebook accounts that have synced automatically (in iOS6). FYI, it does return the name, email, and phone numbers from the synced contacts. Is there a way to get the Facebook IDs of contacts retrieved from Facebook?
Here is the code I am using:
ABMultiValueRef profiles = ABRecordCopyValue(record_, kABPersonSocialProfileProperty);
CFIndex multiCount = ABMultiValueGetCount(profiles);
for (CFIndex i=0; i<multiCount; i++) {
NSDictionary* profile = (__bridge NSDictionary*)ABMultiValueCopyValueAtIndex(profiles, i);
NSLog(@"Profile: %@", profile);
}
CFRelease(profiles);