I have an app that is loading all of a users contacts. I would like to exclude any business, but I can't seem to find a way to determine if a contact is a business.
I initially considered check if the "company" field contains a value when the first and last name do not, but I can't find this property from the ABRecord.
Here is how I am grabbing the first and last name:
NSString *firstName = (__bridge_transfer NSString *)ABRecordCopyValue(contactPerson, kABPersonFirstNameProperty);
NSString *lastName = (__bridge_transfer NSString *)ABRecordCopyValue(contactPerson, kABPersonLastNameProperty);
Any ideas? Thanks!
You can get the firm name via:
You could filter your array on the basis of whether there is an organization name, but no first name or last name.
But, if you want to exclude businesses, you don't really care about the company name (because people may have company name, but businesses generally don't have first/last names). Just filter your records to include only those with first and/or last name:
Alternatively, you could look at the
kABPersonKindProperty
:Whether you're comfortable relying on this
kABPersonKindProperty
Is up to you. I'm unsure if it's properly populated with sources like Microsft Exchange, much less whether all end-users will have always clicked the appropriate checkbox.