如何获取IOS中常用的联系人?

时间:2022-09-02 10:59:11

What I'm trying to achieve is, I want to get the list of contacts which are frequently used in IOS, but I don't know how to do this and couldn't find any way to get this done. Right now, I'm fetching all of the contacts using the below code:

我想要实现的是,我想获得IOS中经常使用的联系人列表,但我不知道如何做到这一点,并且找不到任何方法来完成这项工作。现在,我使用以下代码获取所有联系人:

ABAddressBookRef addressBook = ABAddressBookCreate( );
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople( addressBook );
CFIndex nPeople = ABAddressBookGetPersonCount( addressBook );

for ( int i = 0; i < nPeople; i++ )
{
    ABRecordRef ref = CFArrayGetValueAtIndex( allPeople, i );
    ...
}

1 个解决方案

#1


1  

Unfortunately, no. There is currently (as of iOS 10) no way in the Contacts API of retrieving most frequently used contacts.

很不幸的是,不行。目前(从iOS 10开始)在Contacts API中无法检索最常用的联系人。

#1


1  

Unfortunately, no. There is currently (as of iOS 10) no way in the Contacts API of retrieving most frequently used contacts.

很不幸的是,不行。目前(从iOS 10开始)在Contacts API中无法检索最常用的联系人。