Client
Interface that connects, logs in, and manages push notifications tokens.
Methods
connect
connect(options: , callback: ): Unit
Connects to the Voximplant cloud.
Parameters
options:
Connect options
callback:
Object to receive the result of this operation
Returns
type:
Unit
disconnect
disconnect(): Unit
Closes the connection with the Voximplant Cloud.
If this method is called while client is disconnected, ClientSessionListener.onConnectionClosed is triggered with DisconnectReason.AlreadyDisconnected reason.
Returns
type:
Unit
handlePushNotification
handlePushNotification(notification: Map<String, String>
): Unit
Handles an incoming push notification.
Parameters
notification:
Map<String, String>
Incoming push notification that comes from FirebaseMessagingService.onMessageReceived(RemoteMessage remoteMessage)
Returns
type:
Unit
login
login(username: String
, password: String
, callback: ): Unit
Logs in to the specified Voximplant application with password.
Parameters
username:
String
Full user name, including app and account name, like
someuser@someapp.youraccount.voximplant.compassword:
String
User password
callback:
Returns
type:
Unit
loginWithAccessToken
loginWithAccessToken(username: String
, accessToken: String
, callback: ): Unit
Performs login via the specified username and access token that has been obtained in LoginCallback.onSuccess callback before.
Parameters
username:
String
Full user name, including app and account name, like
someuser@someapp.youraccount.voximplant.comaccessToken:
String
Access token that is obtained in onLoginSuccessful callback
callback:
Returns
type:
Unit
loginWithOneTimeKey
loginWithOneTimeKey(username: String
, hash: String
, callback: ): Unit
Performs login via one time key that has been generated before.
Parameters
username:
String
Full user name, including app and account name, like
someuser@someapp.youraccount.voximplant.comhash:
String
Hash that is generated via the following formula:
MD5(oneTimeKey+"|"+MD5(user+":voximplant.com:"+password))Please note that here user is just a user name, without app name, account name or anything else after "@".
callback:
Returns
type:
Unit
refreshToken
refreshToken(username: String
, refreshToken: String
, callback: ): Unit
Performs refresh of login tokens required for login via access token.
Parameters
username:
String
Full user name, including app and account name, like
someuser@someapp.youraccount.voximplant.comrefreshToken:
String
Refresh token that is obtained in onLoginSuccessful callback
callback:
Returns
type:
Unit
registerForPushNotifications
registerForPushNotifications(pushConfig: , callback: ): Unit
Registers for push notifications. Application can receive push notifications from Voximplant Server after first log in.
The API may be called in any client state, but the push token is registered only after login successful.
Parameters
pushConfig:
Push token configuration
callback:
OptionalObject to receive the result of this operation
Returns
type:
Unit
requestOneTimeKey
requestOneTimeKey(username: String
, callback: ): Unit
Generates one time login key for automated login process.
Parameters
username:
String
Full user name, including app and account name, like
someuser@someapp.youraccount.voximplant.comcallback:
Returns
type:
Unit
setClientSessionListener
setClientSessionListener(listener: ): Unit
Sets the ClientSessionListener listener to handle events related to the connection with the Voximplant Cloud.
Parameters
listener:
OptionalClientSessionListener listener or null. If null, previously set listener is removed
Returns
type:
Unit
unregisterFromPushNotifications
unregisterFromPushNotifications(pushConfig: , callback: ): Unit
Unregisters from push notifications. Application can no longer receive push notifications from the Voximplant server.
The API may be called in any Client state, but the push token is unregistered only after a successful login.
Parameters
pushConfig:
Configuration for push notifications including push token and bundle id
callback:
OptionalObject to receive the result of this operation
Returns
type:
Unit
Props
displayName
displayName: Gets the current user's display name. Display name is available only when the user is logged in, otherwise the property returns null.
Returns
type:
String?