SessionService

The SessionService allows an application to register participants' information in the Voxeet service. The application needs to open a session before it can interact with the service further. The application may open and close sessions multiple times.

Typical application workflow:

1. The application opens a session using the open method.

2. The application can check state of the WebSocket by monitoring the SocketStateChangeEvent or using the istOpen method.

3. The application closes the session using the close method.

Using the SessionService the application can also check whether the specific participant is a local participant or an external participant.

Available in the package com.voxeet.sdk.services.SessionService.

Methods

open

open(@NonNull participantInfo: ParticipantInfo): Promise

Opens a new session.

Note: The external ID field in this API has been deprecated; now you can provide the external ID only when requesting a client access token. If you provide to this API an external ID that is different from the one in your client access token, it will be rejected.

Parameters

NameTypeDescription
participantInfoParticipantInfonon null ParticipantInfo which should contain at least one ParticipantName

Returns: @NonNull Promise - the promise to resolve.


open

open(): Promise

Opens a session using information from the previously closed session. It can also create a temporary "ghost" session.

Returns: @NonNull Promise - the promise to resolve.


isOpen

isOpen(): boolean

Checks whether there is an open session that connects SDK with backend.

Returns: boolean - Information if a session is open.


isLocalParticipant

isLocalParticipant(@NonNull participant: Participant): boolean

Checks if the specific participant is a local participant or an external participant.

Parameters

NameTypeDescription
participantParticipantnon null valid participant's ID

Returns: boolean - in the case of local participants, the application receives the same Voxeet IDs.


close

close(): Promise

Logs out from the current session.
Logging out cancels all logging processes and leaves the conference.

Returns: @NonNull Promise - the promise to resolve.


update

update(@Nullable name: String, @Nullable avatarUrl: String): Promise

Updates the local participant's name and avatar URL. This method is supported in SDK 3.9 and later.

Parameters

NameTypeDescription
nameStringnullable The preferred participant name.
avatarUrlStringnullable The preferred avatar URL.

Returns: @NonNull Promise - A promise to resolve.

Events

SocketStateChangeEvent

Emitted when the WebSocket state has changed.

Available in the package com.voxeet.sdk.events.sdk.SocketStateChangeEvent.

state (WebSocketState)

The new state of the socket.