I am trying to fetch multiple phone numbers from the contacts of device.
It's working fine if the contact have only one number, but it's f***** when they have multiple numbers (which means that I'm getting "\U00a" in between the numbers).
I tried every solution I could think of, but it's still not working.
ABMultiValueRef phonesRef = ABRecordCopyValue(person, kABPersonPhoneProperty);
for (int i = 0; i < ABMultiValueGetCount(phonesRef); i++) {
CFStringRef currentPhoneLabel = ABMultiValueCopyLabelAtIndex(phonesRef, i);
CFStringRef currentPhoneValue = ABMultiValueCopyValueAtIndex(phonesRef, i);
if (CFStringCompare(currentPhoneLabel, kABPersonPhoneMobileLabel, 0) == kCFCompareEqualTo) {
[contactInfoDict setObject:(__bridge NSString *) currentPhoneValue forKey:@"mobileNumber"];
}
else if (CFStringCompare(currentPhoneLabel, kABHomeLabel, 0) == kCFCompareEqualTo) {
[contactInfoDict setObject:(__bridge NSString *) currentPhoneValue forKey:@"homeNumber"];
}
CFRelease(currentPhoneLabel);
CFRelease(currentPhoneValue);
}
You can use Contacts Framework. Hope this will provide you direct solution for contacts.