Cordova Functions

TrueConfAbout 7 min

Cordova Functions

Below is a list of features used in the development of cross-platform mobile applications with Cordova.

start

Launching the SDK after completing the initial setup.

Parameters:

  • server (optional) – the server to connect to (String).

stop

Stopping the SDK instance and releasing resources.

loginAs

Authorization as a specific user with specified parameters on the server.

Parameters:

  • user – user ID (String);

  • password – password (String);

  • encryptPasswordtrue if the password is transmitted in plain text (and needs to be encrypted by the SDK); false if it is already encrypted (Boolean);

  • enableAutoLogin – whether to automatically log in the user with this ID upon restart (Boolean).

Return value (Boolean): true - the authorization request has been sent to the server, false - authorization is not possible.

logout

Deauthorize (log out) an account without disconnecting the SDK from the video conferencing server.

Return value (Boolean): true - the deauthorization request has been sent to the server, false - deauthorization cannot be performed.

callTo

Call the specified subscriber.

Parameters:

  • userTrueConf ID of the called subscriber (String).

Return value (Boolean): true - the call was sent to the server, false - the call cannot be made.

joinConf

Connecting to a group conference.

Parameters:

Return value (Boolean): true if the call has been sent to the server, false if the call cannot be made.

hangup

Ending the current call or conference.

Parameters:

  • forAll – in the case of a conference, whether to end it for all participants if authorized (Boolean). The default is true.

Return value (Boolean): true - the call can be ended, false - the call cannot be ended (usually due to an incorrect state).

acceptCall

Answering an incoming call.

Parameters:

  • accept – accept or decline a call (Boolean).

Return value (Boolean): true - a response to the request can be made, false - a response is not possible.

The function receives a command as a string, detailing which server to connect to, which account to use for authentication, and which call to make. It then automatically performs all these operations.

Parameters:

  • cmd – the string being processed (String).

scheduleLoginAs

Retrieving a list of operations that need to be performed sequentially, including the server to connect to, account credentials, and the call recipient's details. This is equivalent to the function ParseProtocolLink, where parameters are provided separately rather than as a protocol string. String parameters may be empty.

Parameters:

  • login – user identifier (String);

  • pwd – password (String);

  • encryptPasswordtrue if the password is transmitted in plain text (and needs to be encrypted by the SDK), false if it is already encrypted (Boolean);

  • callToUser – the identifier of the called subscriber (String);

  • autoClose – whether to close the session with the server after completing or interrupting a call (Boolean);

  • loginTemp – indicates a temporary login. It means the client should be deauthorized after the call (Boolean);

  • loginForce – forced login. Authentication will be performed even if the client is already authenticated on the server (Boolean);

  • domain – the domain where automatic server search will be performed (String);

  • serversList – the list of servers to connect to (String);

  • isPublic – a parameter indicating that callToUser is a conference name, not a username. If this parameter is incorrect, the call to the user or connection to the conference will not be executed (Boolean).

muteMicrophone

Changing the microphone status.

Parameters:

  • mute – the state to set the microphone to: true – off, false – on (Boolean).

muteCamera

Camera status change.

Parameters:

  • mute – the state to set the camera to: true – off, false – on (Boolean).

getMyId

Obtaining your personal ID.

Return value (String): the ID of the current user in the system.

getMyName

Retrieving your own display name for the interface.

Return value (String): the name of the current user.

isStarted

Check of the SDK instance operational status, resulting in a Boolean type.

isConnectedToServer

Checking connection to the server.

Return value (Boolean): true - connected to the server, false - no connection to the server.

isLoggedIn

Checking authorization status.

Return value (Boolean): true - the user is authorized on the server, false - the user is not authorized.

isInConference

Checking conference participation.

Return value (Boolean): true - the client is in a conference, false - the client is not in a conference.

getUserStatus

Fetching the status of another user. If the status is known, it is returned immediately. If not, the status is requested from the server, and the client subscribes to notifications about its changes.

Parameters:

  • userTrueConf ID of the user whose status is being requested (String).

Return value (Number): the current status of the user.

isMicrophoneMuted

Checking the microphone status.

Return value (Boolean): true - disabled, false - enabled.

isCameraMuted

Checking the camera status.

Return value (Boolean): true - disabled, false - enabled.

acceptRecord

Response to an incoming video recording request.

Parameters:

  • accept – accept or decline a video recording request (Boolean);

  • userID – the TrueConf ID of the user to whom the request response is given (String).

sendChatMessage

Sending a text message.

Parameters:

  • userID – the TrueConf ID of the user to whom the message is sent (it is recommended to use the full ID in the format user@server.name) (String). To send a message to the chat of the current group conference, this parameter should be empty.

  • message – message text (String);

Return value (bool) – true if the message is sent to the server, false if the message fails to send due to lack of server connection.

showAlertPage

A feature to display another window on top of the conference window.

Parameters:

  • alertText – text to display in another window (String).

addExtraButton

The feature allows adding custom buttons to the conference control panel. Button presses should be handled in the onExtraButtonPressed event.

Parameters:

  • title – button title (String).

getInstance

SDK instance retrieval function.

Return value (Promise.<TrueConfSDK>): A promise containing the SDK instance, which will be invoked after the SDK has been initialized.

addEventListener

Connecting a listener for a specific SDK event.

Parameters:

  • name – event name (String);

  • callback – event handler function (Function).

removeEventListener

Removing a listener for a specific SDK event.

Parameters:

  • name – event name (String);

  • callback – event handler function (Function).

clearEventListeners

Removing all listeners or a listener for a specific SDK event.

Parameters:

  • name (optional) – the name of the event (String). If this parameter is not specified, all listeners will be removed.