IamUtil.pairPasswordInviteAsync() Overload 1
DESCRIPTION
Perform Password Invite pairing asynchronously.
The specified AsyncIamResultReceiver closure is invoked with IamError.OK upon successful completion or with an error if an error occurs. See the pairPasswordInvite()
function for details about possible error codes.
DECLARATION
static public func pairPasswordInviteAsync(connection: Connection,
username: String,
password: String,
closure: @escaping AsyncIamResultReceiver)
PARAMETERS
connection:
- An established connection to the device this client should be paired with
username:
- Username for the invited user
password:
- Password for the invited user
closure:
- Invoked when the pairing attempt succeeds or fails.
Overload 2
DESCRIPTION
Perform Password Invite pairing asynchronously.
Uses Swift concurrency and is therefore only available on iOS 13 and above.
DECLARATION
static public func pairPasswordInviteAsync(connection: Connection, username: String, password: String) async throws
PARAMETERS
connection:
- An established connection to the device this client should be paired with
username:
- Username for the invited user
password:
- Password for the invited user
THROWS ERRORS
AUTHENTICATION_ERROR:
- if authentication failed using the specified username/password combination for the device
BLOCKED_BY_DEVICE_CONFIGURATION:
- if the device configuration does not support local open pairing (the
IAM:PairingPasswordInvite
action is not set for the Unpaired role or the device does not support the pairing mode at all) PAIRING_MODE_DISABLED:
- if the pairing mode is configured on the device but is disabled at runtime
TOO_MANY_WRONG_PASSWORD_ATTEMPTS:
- if the client has attempted to authenticate too many times with a wrong password (try again after 10 seconds)
IAM_NOT_SUPPORTED:
- if Nabto Edge IAM is not supported by the device