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 session using information from the ParticipantInfo model.
Parameters
Name | Type | Description |
---|---|---|
participantInfo | ParticipantInfo | non 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
Name | Type | Description |
---|---|---|
participant | Participant | non 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
Name | Type | Description |
---|---|---|
name | String | nullable The preferred participant name. |
avatarUrl | String | nullable 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.
Updated 43 minutes ago