# iOS/iPadOS 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 isYES
.
# 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
);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 (Bool
): true
- the authorization request was sent to the server, false
- authorization cannot be performed.
# logout
Deauthorization (log out) of an account without disconnecting the SDK from the video conferencing server.
Return value (Bool
): true
- the deauthorization request has been sent to the server; false
- deauthorization cannot be performed.
# callTo
Call to the specified subscriber.
Parameters:
user
– TrueConf ID of the called party (string).
Return value (Bool
): true
- call was sent to the server, false
- call cannot be made.
# joinConf
Joining a group conference.
Parameters:
conf_ID
– conference ID (string).pwd
(optional) – password to join the conference (String
);
Return value (Bool
): true
when the call is sent to the server, false
when the call cannot be made.
# hangup
Ending the current call or conference.
Parameters:
forAll
(optional) – in the case of a conference, whether to end it for all participants if authorized (Bool
). Defaults totrue
.
Return value (Bool
): true
- the call can be terminated, false
- the call cannot be terminated (usually due to an incorrect state).
# acceptCall
Answering an incoming call.
Parameters:
accept
– accept or decline a call (Bool
).
Return value (Bool
): true
- the request can be responded to, false
- the 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
Retrieving a list of operations that must be executed sequentially, including the server to connect to, account credentials, and the call recipient's address. This is equivalent to the function parseProtocolLink
, where parameters are passed separately rather than as a protocol string. String parameters can 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 (Bool
);callToUser
– identifier of the called user (String
);autoClose
– whether to close the session with the server after completing or interrupting the call (Bool
);loginTemp
- temporary login indicator. It means that the client should be deauthorized after the call (Bool
);loginForce
– forced login. Authentication will occur even if the client is already authenticated on the server (Bool
);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 a conference name rather than a user name. If this parameter is incorrect, the call to the user or connection to the conference will not be completed (Bool
).
# muteMicrophone
Changing the microphone status.
Parameters:
mute
– the state to set the microphone:true
– muted,false
– unmuted (Bool
).
# muteCamera
Camera status change.
Parameters:
mute
– the state to set the camera to:true
– off,false
– on (Bool
).
# muteAudio
Changing the speaker status.
Parameters:
mute
– the state to which the speaker should be set:true
– off,false
– on (Bool
).
# getMyId
Getting your own ID.
Return value (String
): the current user's identifier in the system. If the user is not authenticated 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 authorized on the server.
# isConnectedToServer
Checking the connection to the server.
Return value (Bool
): true
- connection to the server is established, false
- no connection to the server.
# isLoggedIn
Checking authorization status.
Return value (Bool
): true
- the user is authorized on the server, false
- the user is not authorized.
# isInConference
Checking conference presence.
Return value (Bool
): 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
): current user status.
# isMicrophoneMuted
Microphone status check.
Return value (Bool
): true
- disabled, false
- enabled.
# isCameraMuted
Camera status check.
Return value (Bool
): true
- disabled, false
- enabled.
# isAudioMuted
Checking speaker status.
Return value (Bool
): true
- disabled, false
- enabled.
# acceptRecord
Response to an incoming video recording request.
Parameters:
accept
– accept or decline the video recording request (Bool
);userID
– TrueConf 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 formatuser@server.name
). To send a message to the chat of the current group conference, this parameter should be left empty.text
– message text (string);
Return value (Bool
): true
- the message was sent to the server, false
- the message could not be sent due to a lack of server connection.
# setNewExtraButtons
Adding additional buttons to the conference control panel. The buttons will be added to the list that opens by tapping the ellipsis button, following the order they appear in the provided array. See Example 5.
Parameters:
btns
– an array of objects of typeTCSDKExtraButton
(NSArray
).
# presentViewController
Presentation of another UIViewController over the conference window.
Parameters:
viewControllerToPresent
– window for presentation (UIViewController
);flag
- presentation process animation (Bool
);popoverFrom
- the element over which the presentation will be executed (Any
). You can specifynil
for this parameter, in which case, if the UIModalPresentationPopover style is specified, it will be forcibly performed as UIModalPresentationFullScreen;completion
- a block that will execute after the presentation concludes. You can specifynil
for this parameter.
# getUserName
Retrieving the display name of another user.
Parameters:
user
– the TrueConf ID of the user whose name is being requested (String
).
Return value (String
): the username.
# getAudioDeviceList
Retrieving the current list of audio output devices.
Return value (array TCSDKAudioDevice
): an array of audio output devices.
# audioDevice
Property for getting and setting the current audio output device.
Type: TCSDKAudioDevice
# resources
A property for setting a resource bundle. It is used to replace default images with custom ones.
Type: NSBundle
# swapCamera
Switching between front and rear cameras.
# xview
A property to set the parent element for the window where other conference participants are displayed.
Type: UIView
# xsview
Property to set the parent element for the self-view window.
Type: UIView
# joinWithMic
Property to set the default microphone state when joining a conference. Default is true
.
Type: Bool
# joinWithVideo
Property to set the default camera state when joining a conference. Default is true
.
Type: Bool
# hideConfControls
Property for setting the default state of the bottom panel with conference control elements. The default is false
.
Type: Bool
# windowsDelegate
Property for implementing TCWindowsDelegate
protocol methods.
# tcWindowsGetPlaces
The TCWindowsDelegate
protocol method is used to adjust the size and position of the video windows of other conference participants. It is called automatically when the SDK needs to reconstruct the received video from other participants.
Parameters:
aWindows
is an array of conference participant video windows of typeTCSDKWindowRect
. For each such object, you can modify the propertiesCGRect
rect,CGSize
resolution, andString
userId;aSize
– window coordinates (CGSize
)
Return value: an array of TCSDKWindowRect
objects.