Instance Method

discoverAllContactUserInfosWithCompletionHandler:

Retrieves information about all discoverable users that are known to the current user.

Declaration

- (void)discoverAllContactUserInfosWithCompletionHandler:(void (^)(NSArray<CKDiscoveredUserInfo *> *userInfos, NSError *error))completionHandler;

Parameters

completionHandler

The block to execute with the results. Your block must be capable of executing on any thread of the app. This block returns no value and takes the following parameters:

userInfos

An array of CKDiscoveredUserInfo objects. Each object in the array contains information about the user, including the ID of the corresponding user record. If no users are discovered, the provided array is empty.

error

An error object if a problem occurs, or nil if the IDs are retrieved successfully.

Discussion

Use this method to retrieve information about other users of the app. This method returns information about those users who meet the following criteria:

  • There is contact information for the user in the current user’s address book.

  • The user has run the app.

  • The user has granted the CKApplicationPermissionUserDiscoverability permission to your app for this container.

This method searches for the users asynchronously and with a low priority. If you want the task to execute with a higher priority, create a CKDiscoverAllContactsOperation object and configure the desired priority.

See Also

Discovering User Records

- discoverAllIdentitiesWithCompletionHandler:

Fetches all user records that match an entry in the user’s address book.

- discoverUserIdentityWithEmailAddress:completionHandler:

Returns the user record ID associated in the user’s contacts with the email address.

- discoverUserIdentityWithPhoneNumber:completionHandler:

Returns the user record ID associated in the user’s contacts with the phone number.

- discoverUserIdentityWithUserRecordID:completionHandler:

Retrieves information about a single user based on the ID of the corresponding user record.

- discoverUserInfoWithEmailAddress:completionHandler:

Retrieves information about a single user based on that user’s email address.

Deprecated
- discoverUserInfoWithUserRecordID:completionHandler:

Retrieves information about a single user based on the ID of the corresponding user record.

Deprecated
- fetchShareParticipantWithEmailAddress:completionHandler:

Retrieves information about a single share participant (a person who accepted a shared record) based on that participant’s email address.

- fetchShareParticipantWithPhoneNumber:completionHandler:

Retrieves information about a single share participant (a person who accepted a shared record) based on that participant’s phone number.

- fetchShareParticipantWithUserRecordID:completionHandler:

Retrieves information about a single share participant based on the ID of the corresponding user record.

- fetchUserRecordIDWithCompletionHandler:

Returns the user record ID associated with the current user.