fetchShareParticipants(forPhoneNumbers:completionHandler:)
Fetches share participants with the specified phone numbers.
Declaration
@preconcurrency func fetchShareParticipants(forPhoneNumbers phoneNumbers: [String], completionHandler: @escaping @Sendable (Result<[String : Result<CKShare.Participant, any Error>], any Error>) -> Void)Parameters
- phoneNumbers:
The share participants’ phone numbers.
- completionHandler:
The handler to execute with the fetch results.
Discussion
The closure doesn’t return a value and takes the following parameters:
A dictionary of fetched share participants. The dictionary uses the phone numbers you specify in
phoneNumbersas its keys. The value of each key is a Result that contains either the corresponding fetched share participant, or an error that describes why CloudKit can’t fetch that share participant.
CloudKit can translate any valid phone number into a share participant. If the phone number doesn’t correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the phone number to an iCloud account.
This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of CKFetchShareParticipantsOperation and configure it to use the necessary priority.