I can successfully retrieve the phone numbers associated to a contact, but for sharing purposes I need to find out which number is the contact's mobile phone number.
The type can be retrieved using the following code;
ABMultiValueRef phonesRef = ABRecordCopyValue(person, kABPersonPhoneProperty);
if(phonesRef) {
long count = ABMultiValueGetCount(phonesRef);
for(int ix = 0; ix < count; ix++){
CFStringRef typeTmp = ABMultiValueCopyLabelAtIndex(phonesRef, ix);
CFStringRef numberRef = ABMultiValueCopyValueAtIndex(phonesRef, ix);
CFStringRef typeRef = ABAddressBookCopyLocalizedLabel(typeTmp);
CFStringRef typeRef = ABAddressBookCopyLocalizedLabel(typeTmp);
NSString *phoneType = (__bridge NSString *)typeRef;
}
}
However, how do I check if that very type is mobile? I mean sure, I could just compare the String to "mobile", but naturally that won't work in a localized environment.
Is there a constant I can compare this to?