Contents

retrieveAllCredentials(_:)

Requests all Thread credentials from the framework.

Declaration

func retrieveAllCredentials(_ completion: @escaping  @Sendable (Set<THCredentials>?, (any Error)?) -> Void)
func allCredentials() async throws -> Set<THCredentials>

Parameters

  • completion:

    The completion handler the framework calls when the credentials become available.

Mentioned in

Discussion

The framework identifies the developer by the team ID. When calling this method, you receive credentials for your team ID only.

Call the method as follows:

func obtainAllCredentials() async -> (Set<THCredentials>?, Error?) {
    let client = THClient()
    var credentials: Set<THCredentials>?
    var err:Error?
    do {
        credentials = try await client.allCredentials()
    } catch {
        err = error
    }
    return (credentials, err)
}

See Also

Retrieving Credentials