# React Native Functions
Below is a list of features used in the development of cross-platform mobile applications using React Native.
# start
Launching SDK after initialization.
Parameters:
server
(optional) – the server to connect to (String
).
# stop
Stopping the SDK instance and releasing resources.
# loginAs
Authorization as a specific user with the specified parameters on the server.
Parameters:
user
- user ID (String
);password
– password (String
);encryptPassword
–true
if the password is transmitted in plain text (and the SDK needs to encrypt it),false
if it is already encrypted (Boolean
);enableAutoLogin
– whether to automatically authenticate the user with this ID upon re-launch (Boolean
).
Return value (Boolean
) – true
if the authorization request is sent to the server, false
if the authorization cannot be performed.
# logout
Deauthorization (log out) of an account without disconnecting the SDK from the video conferencing server.
Return value (Boolean
) – true
if the deauthorization request was sent to the server, false
if deauthorization cannot be performed.
# callTo
Call to the specified subscriber.
Parameters:
user
– TrueConf ID of the called party (string).
The return value (Boolean
) is true
if the call is sent to the server, false
if the call cannot be made.
# joinConf
Joining a group conference.
Parameters:
conferenceId
– conference ID (String
).
The return value (Boolean
) is true
if the call is sent to the server, false
if the call cannot be made.
# hangup
Ending the current call or conference.
Parameters:
forAll
(optional) – in the case of a conference, determines whether it should be ended for all participants if authorized (Boolean
). The default istrue
.
Return value (Boolean
) — true
if the call can be ended, false
if 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
if a response to the request can be made, false
if a response is not possible.
# parseProtocolLink
The function receives a command as a string, containing instructions on which account to authenticate and which call to make. It then automatically executes all these operations. If execution of the command is halted at any stage.
Parameters:
cmd
- the string being processed (String
).
# scheduleLoginAs
Obtaining a list of operations that need to be executed sequentially, including the server to connect to, account credentials, and the recipient's call details. This is equivalent to the function parseProtocolLink
, where parameters are not passed as a protocol string but individually. String parameters may be empty.
Parameters:
login
– user ID (String
);pwd
– password (String
);encryptPassword
–true
if the password is transmitted in plain text (and the SDK needs to encrypt it),false
if it is already encrypted (Boolean
);callToUser
– identifier of the called user (String
);autoClose
– indicates whether to close the session with the server after completing a call or interrupting execution (Boolean
);loginTemp
– indicates a temporary login. It means that the client should be logged out after the call (Boolean
);loginForce
– forced login. Authentication will occur even if the client is already authenticated on the server (Boolean
);domain
- the domain in which the automatic server search will be performed (string);serversList
– a list of servers to connect to (string);isPublic
- a parameter indicating thatcallToUser
is the name of a conference, not a user name. If this parameter is incorrect, the call to the user or connection to the conference will not be successful (Boolean
).
# muteMicrophone
Changing the microphone status.
Parameters:
mute
– the state to set the microphone:true
– microphone is off,false
– microphone is on (Boolean
).
# muteCamera
Camera status change.
Parameters:
mute
– the state to set the camera to:true
– camera off,false
– camera on (Boolean
).
# getMyId
Getting your own ID.
Return value (String
): the current user's identifier in the system.
# getMyName
Obtaining a custom name for display in the interface.
Return value (String
): the current user's name.
# isStarted
Check the operational status of the SDK instance, result type Boolean
.
# isConnectedToServer
Checking the 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 authenticated on the server, false
- the user is not authenticated.
# isInConference
Checking conference presence.
Return value (Boolean
): true
- the client is in a conference, false
- the client is not in a conference.
# getUserStatus
Retrieving another user's status. If the status is known, it is returned immediately. If not, the status is requested from the server, and the client subscribes to receive notifications of any changes.
Parameters:
user
– the TrueConf ID of the user whose status is being requested (string).
Return value (Number
): the current status of the user.
# isMicrophoneMuted
Microphone status check.
Return value (Boolean
): true
- disabled, false
- enabled.
# isCameraMuted
Camera status check.
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
– TrueConf ID of the user to whom the response to the request 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 formatuser@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 on another window (String
).
# addExtraButton
The feature of adding additional custom buttons to the conference control panel. The button press should be handled in the onExtraButtonPressed
event.
Parameters:
title
– button label (String
).
# initCustomViews
Initialization and configuration of custom windows for displaying self-view video and the conference window.
# addEventListener
Connecting a listener for a specific SDK event.
Parameters:
name
– event name (String
);handler
– event handler function (Function
).
# removeAllListeners
Removing all listeners or a listener of a specific SDK event.
Parameters:
name
(optional) – the name of the event (String
). If the parameter is not specified, all listeners will be removed.