IamUtil.getCurrentUserAsync() Overload 1
DESCRIPTION
Asynchronously get details about a specific user.
The specified AsyncIamResultReceiver closure is invoked with IamError.OK and an IamUser object upon successful completion or with an error if an error occurs. See the getCurrentUser()
function for details about possible error codes.
DECLARATION
static public func getCurrentUserAsync(connection: Connection,
closure: @escaping AsyncIamResultReceiverWithData<IamUser>)
PARAMETERS
connection:
- An established connection to the device
closure:
- Invoked when the user information is successfully retrieved or retrieval fails.
Overload 2
DESCRIPTION
Asynchronously get details about the user that has opened the current connection to the device.
Uses Swift concurrency and is therefore only available on iOS 13 and above.
DECLARATION
static public func getCurrentUserAsync(connection: Connection) async throws -> IamUser
PARAMETERS
connection:
- An established connection to the device
THROWS ERRORS
USER_DOES_NOT_EXIST:
- if the current user is not paired with the device.
IAM_NOT_SUPPORTED:
- if Nabto Edge IAM is not supported by the device
RETURNS
an IamUser instance describing the current user