IamUtil.pairLocalInitialAsync() Overload 1

DESCRIPTION

Perform Local Initial pairing asynchronously.

The specified AsyncIamResultReceiver closure is invoked with IamError.OK upon successful completion or with an error if an error occurs. See the pairLocalInitial() function for details about possible error codes.

DECLARATION

static public func pairLocalInitialAsync(connection: Connection, closure: @escaping AsyncIamResultReceiver)

PARAMETERS

connection:
An established connection to the device this client should be paired with
closure:
Invoked when the connect attempt succeeds or fails.

Overload 2

DESCRIPTION

Perform Local Initial pairing asynchronously.

Uses Swift concurrency and is therefore only available on iOS 13 and above.

In this mode, the initial user can be paired on the local network without providing a username or password - and only the initial user. This is a typical bootstrap scenario to pair the admin user (device owner).

Read more here: https://docs.nabto.com/developer/guides/concepts/iam/pairing.html#initial-local

DECLARATION

static public func pairLocalInitialAsync(connection: Connection) async throws

PARAMETERS

connection:
An established connection to the device this client should be paired with

THROWS ERRORS

INITIAL_USER_ALREADY_PAIRED:
if the initial user was already paired
BLOCKED_BY_DEVICE_CONFIGURATION:
if the device configuration does not support local open pairing (the IAM:PairingLocalInitial 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.
INITIAL_USER_ALREADY_PAIRED:
if the initial user was already paired.
IAM_NOT_SUPPORTED:
if Nabto Edge IAM is not supported by the device