如何识别iOS中从Facebook导入的联系人

时间:2014-08-21 13:22:48

标签: ios addressbook

我正在通过地址簿访问联系人。我不想在复制其他联系人时导入Facebook联系人。那么如何识别联系人是否从Facebook导入? 为了复制人的数组,我使用这个简单的方法:

ABRecordRef source = ABAddressBookCopyDefaultSource(ref);
NSArray *allContacts  = (__bridge NSArray *)(ABAddressBookCopyArrayOfAllPeopleInSource(ref, source));

for(int i = 0; i< [allContacts count]; i ++)         {

Person * person = [[Person alloc] init];

ABRecordRef contactPerson =(__ bridge ABRecordRef)allContacts [i];

NSString * firstName =(__ bridge_transfer NSString *)ABRecordCopyValue(contactPerson,kABPersonFirstNameProperty);

NSString * lastName =(__ bridge_transfer NSString *)ABRecordCopyValue(contactPerson,kABPersonLastNameProperty);

int ID = ABRecordGetRecordID(contactPerson);

        CFTypeRef num=ABRecordCopyValue(contactPerson, kABPersonPhoneProperty);

        NSString  *phoneNumber = (__bridge NSString *) ABMultiValueCopyValueAtIndex(num, 0);


       if(phoneNumber.length>0)
        {
         [List addObject:person];
        }

那么记录的哪个属性能够检测到Facebook联系人?

0 个答案:

没有答案