SessionService

The SessionService allows the application to register the local participant's information in the Voxeet service. The service allows opening and closing sessions. The application needs to open a session before interacting with any service.

Accessors

delegate

delegate: VTSessionDelegate

Delegate, a means of communication between objects in the session service.

Returns: VTSessionDelegate


participant

participant: VTParticipant

Provides the local participant object that belongs to the current session.

Returns: VTParticipant

Methods

open

open(options: VTParticipantInfo?, completion: ((_ error: NSError?) -> Void)?)

Opens a new session. If you initialize the SDK with a client access token, provide the external ID in the REST API request, not in the open method. Otherwise, you may expect the platform to either ignore the external ID provided in the open method or receive an error if the provided ID is different from the one provided in the REST API request.

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:

NameTypeDefaultDescription
optionsVTParticipantInfonilThe optional information about the local participant.
completion((_ error: NSError?) -> Void)?nilThe block to execute when the query completes.

isOpen

isOpen() -> Bool

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

Returns: Bool


close

close(completion: ((_ error: NSError?) -> Void)?)

Closes the current session.

NameTypeDefaultDescription
completion((_ error: NSError?) -> Void)?nilThe block to execute when the query completes.

updateParticipantInfo

updateParticipantInfo(name: String, avatarUrl: String, completion: ((_ error: NSError?) -> Void)?)

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

NameTypeDescription
nameStringThe preferred participant name.
avatarUrlStringThe preferred avatar URL.
completion((_ error: NSError?) -> Void)?The block to execute when the query completes.