Rate this page:

Client

This API is in beta and subject to change.

Interface that connects, logs in, and manages push notifications tokens.

Methods

connect

Copy URL
fun connect(options: 

ConnectOptions

,
callback:

ConnectionCallback

):

Unit

This API is in beta and subject to change.

Connects to the Voximplant cloud.

Parameters

Returns

  • type:

    Unit

disconnect

Copy URL
fun disconnect(): 

Unit

This API is in beta and subject to change.

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

requestOneTimeKey

Copy URL
fun requestOneTimeKey(username: 

String

,
callback:

GenerateOneTimeKeyCallback

):

Unit

This API is in beta and subject to change.

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.com

Returns

  • type:

    Unit

loginWithOneTimeKey

Copy URL
fun loginWithOneTimeKey(username: 

String

,
hash:

String

,
callback:

LoginCallback

):

Unit

This API is in beta and subject to change.

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.com

  • hash:

    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:

    LoginCallback

Returns

  • type:

    Unit

loginWithAccessToken

Copy URL
fun loginWithAccessToken(username: 

String

,
accessToken:

String

,
callback:

LoginCallback

):

Unit

This API is in beta and subject to change.

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.com

  • accessToken:

    String

    Access token that is obtained in onLoginSuccessful callback

  • callback:

    LoginCallback

Returns

  • type:

    Unit

login

Copy URL
fun login(username: 

String

,
password:

String

,
callback:

LoginCallback

):

Unit

This API is in beta and subject to change.

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.com

  • password:

    String

    User password

  • callback:

    LoginCallback

Returns

  • type:

    Unit

refreshToken

Copy URL
fun refreshToken(username: 

String

,
refreshToken:

String

,
callback:

RefreshTokenCallback

):

Unit

This API is in beta and subject to change.

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.com

  • refreshToken:

    String

    Refresh token that is obtained in onLoginSuccessful callback

Returns

  • type:

    Unit

handlePushNotification

Copy URL
fun handlePushNotification(notification: 

Map<String, String>

):

Unit

This API is in beta and subject to change.

Handles an incoming push notification.

Parameters

  • notification:

    Map<String, String>

    Incoming push notification that comes from FirebaseMessagingService.onMessageReceived(RemoteMessage remoteMessage)

Returns

  • type:

    Unit

registerForPushNotifications

Copy URL
fun registerForPushNotifications(pushConfig: 

PushConfig

,
callback:

RegisterPushTokenCallback?

):

Unit

This API is in beta and subject to change.

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

Returns

  • type:

    Unit

unregisterFromPushNotifications

Copy URL
fun unregisterFromPushNotifications(pushConfig: 

PushConfig

,
callback:

RegisterPushTokenCallback?

):

Unit

This API is in beta and subject to change.

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:

    PushConfig

    Configuration for push notifications including push token and bundle id

  • Optional

    Object to receive the result of this operation

Returns

  • type:

    Unit

setClientSessionListener

Copy URL
fun setClientSessionListener(listener: 

ClientSessionListener?

):

Unit

This API is in beta and subject to change.

Sets the ClientSessionListener listener to handle events related to the connection with the Voximplant Cloud.

Parameters

  • Optional

    IClientSessionListener listener or null. If null, previously set listener is removed

Returns

  • type:

    Unit

getInstance

Copy URL
@JvmStatic
@JvmOverloads
fun getInstance(context:

Context

,
clientConfig:

ClientConfig

):

Client

This API is in beta and subject to change.

Returns the Client instance.

Parameters

  • context:

    Context

    Application context

  • clientConfig:

    ClientConfig

    Configuration for the Client instance

Returns

Props

clientState

Copy URL
val clientState: 

ClientState

This API is in beta and subject to change.

Gets the current client state.

Returns

displayName

Copy URL
val displayName: 

String?

This API is in beta and subject to change.

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?