# iOS Functions

Here is a list of functions used when developing in Xcode IDE for iOS.

# initWithViewController

SDK object initialization function.

Parameters:

  • vc – used for initializing the view controller (UIViewController);

  • serverIP – the server and port to connect to in the format <server address>:<server port> (NSString);

  • directConnection (optional) - use of a direct connection (BOOL). Default is YES.

# start

Launching SDK after initialization.

# startWithServersList

Starting the SDK after initialization with a list of servers. The addresses from the provided list are iterated through, and connection is made to the first operational server.

Parameters:

  • serversList – a list of server addresses separated by commas (NSString).

# isStarted

Checking the operational status of the SDK instance, result type boolean.

# 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);

  • pwd – password (string);

  • encryptPasswordtrue 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 the specified subscriber.

Parameters:

  • userTrueConf 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:

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 is true.

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.

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);

  • encryptPasswordtrue 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 that callToUser 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 identifier of the current user in the system. If the user is not authorized on the server, Nil is returned.

# getMyName

Obtaining a custom name for display in the interface.

Return value (string) – the name of the current user. Contains Nil if the user is not authenticated on the server.

# isConnectedToServer

Checking the connection to the server.

Return value (boolean) - true if there is a connection to the server, false if there is no connection.

# isLoggedIn

Checking authorization status.

Return value (boolean) – true, the user is authorized on the server; false – the user is not authorized.

# 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 (UserPresStatus) – the current status of the user.

# microphoneMuted

Microphone status check.

Return value (Boolean) – true when the microphone is muted, false – when the microphone is unmuted.

# cameraMuted

Camera status check.

Return value (boolean) – true when the camera is off, false when the camera is on.

# acceptRecord

Response to an incoming video recording request.

Parameters:

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

  • userIDTrueConf ID of the user to whom the response to the request is given (string).

# sendChatMessage

Sending a text message.

Parameters:

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

  • text – (string) message text.

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

# setInitViewController

Called before the call interface is launched. Allows you to override the default view controller in the SDK. It takes precedence over the view controller specified during SDK initialization.

Parameters:

  • aInitViewController – the view controller to be used (UIViewController).

# setNewExtraButtons

Add additional buttons to the conference control panel. The buttons will be added to the list that opens when tapping the ellipsis button (the right button on the panel) in the order they appear in the provided array. See Example 5.

Parameters:

  • btns – an array of objects of type UIAlertAction (NSArray).

# orientationWillChangeTo

It should be called at the start of the interface orientation change. Event relay for the main application controller.

Parameters:

  • toOrientation – new interface orientation (UIInterfaceOrientation).

# orientationDidChangeTo

Should be called upon completion of the interface orientation change. Event relay of the main application controller.

Parameters:

  • toOrientation – new interface orientation (UIInterfaceOrientation)

# trueConfSDKLogEnable

A BOOL type property that enables or disables extended logging. By default, it is set to NO.

# getUserName

The function returns the display name of another user.

Parameters:

  • userTrueConf ID of the user whose name is being requested (string).

Return value (string) – user name.