requestOneTimeLoginKey method
Generates one time login key for the given Voximplant username.
username
- Full user name, including Voximplant user, application, and
account name in the format user@application.account.voximplant.com
.
Throws VIException, if an error occurred, otherwise returns one time key.
Errors:
- VIClientError.ERROR_ACCOUNT_FROZEN - If the account is frozen.
- VIClientError.ERROR_INTERNAL - If an internal error occurred.
- VIClientError.ERROR_INVALID_STATE - If the client is not connected, already logged in, or currently logging in.
- VIClientError.ERROR_INVALID_USERNAME - If the given username is invalid.
- VIClientError.ERROR_NETWORK_ISSUES - If the connection to the Voximplant Cloud is closed while the client is logging in.
- VIClientError.ERROR_TIMEOUT - If timeout occurred.
Implementation
Future<String> requestOneTimeLoginKey(String username) async {
try {
return await _channel.invokeMethod('Client.requestOneTimeKey', username);
} on PlatformException catch (e) {
throw VIException(e.code, e.message);
}
}