Contact is missing some of the required key descriptors in ios

后端 未结 3 1212
被撕碎了的回忆
被撕碎了的回忆 2021-01-04 18:35

I have retrieves all contact by using following method

- (void)getAllContacts:(void(^)(NSArray *array))handler
{
    CNAuthorizationStatus status = [CNContac         


        
3条回答
  •  心在旅途
    2021-01-04 19:18

    Add "CNContactViewController.descriptorForRequiredKeys" at the end of your keysToFetch array.

    Worked for me after I did that.

    Example:

    NSArray *keysToFetch = @[CNContactIdentifierKey, CNContactGivenNameKey, CNContactFamilyNameKey, CNContactPhoneNumbersKey, CNContactImageDataAvailableKey, CNContactImageDataKey, CNContactViewController.descriptorForRequiredKeys];
    

提交回复
热议问题