如何确定 CNContact 是收藏夹?

How can I determine that CNContact is is favorites?

我的 iOS 应用程序使用代码从设备中获取联系人

[[CNContactStore new] requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError *error) {
  if (granted) {
    NSArray *keys = @[CNContactNamePrefixKey,
                      CNContactGivenNameKey,
                      CNContactMiddleNameKey,
                      CNContactFamilyNameKey,
                      // ...
    NSString *containerId = store.defaultContainerIdentifier;
    NSPredicate *predicate = [CNContact predicateForContactsInContainerWithIdentifier:containerId];
    NSArray *cnContacts = [store unifiedContactsMatchingPredicate:predicate keysToFetch:keys error:&error];
    for (CNContact *contact in cnContacts) {
      // contacts fetching
    }
  }
}];

CNContact class 是否有一些值表示联系人在设备上的收藏夹中(在 Phone 应用程序中)?我没有在 CNContact 键中找到这样的键。

或者 predicate 包含我需要的键?

Filip Radelic answered same question:

Favorites are stored inside Phone.app, not inside the Address Book database itself. You can't access other app's sandbox on a non-jailbroken iPhone, so unfortunately the answer is no.

Also, it would be pretty bad for privacy if any app could see your favorite contacts. It's already bad that it can access entire address book without asking you.