Menu

TUICallKit

Last updated: 2023-09-21 15:37:01Download PDF

TUICallKit APIs

TUICallKit is an audio/video call component that includes UI elements. You can use its APIs to quickly implement an audio/video call application similar to WeChat. For directions on integration, see Integrating TUICallKit.

API overview

API
Description
login
Log in
logout
Sign out
Sets the user nickname and profile photo.
call
Makes a one-to-one call.
groupCall
Makes a group call.
Joins a group call.
Sets whether to turn on the mute mode.
Sets whether to enable floating windows.

Details

login

TUIResult result = TUICallKit.instance.login(sdkAppId: 1400000001,
userId: 'xxxxxx',
userSig: 'xxxxxx');

class TUIResult {
String code;
String? message;
TUIResult({required this.code, required this.message});
}
Parameter
Type
Description
sdkAppId
int
User SDKAppID
userId
String
User ID
userSig
String
user signature
return value
TUIResult
Contains code and message information: code = 0 means the call is successful; code != 0 means the call failed, see message for the reason of failure

logout

TUIResult result = TUICallKit.instance.logout()

class TUIResult {
String code;
String? message;
TUIResult({required this.code, required this.message});
}
Parameter
Type
Description
return value
TUIResult
Contains code and message information: code = 0 means the call is successful; code != 0 means the call failed, see message for the reason of failure

setSelfInfo

This API is used to set the alias and profile photo. The alias cannot exceed 500 bytes, and the profile photo is specified by a URL.
TUIResult result = TUICallKit.instance.setSelfInfo('userName', 'url:********');

class TUIResult {
String code;
String? message;
TUIResult({required this.code, required this.message});
}
Parameter
Type
Description
nickName
String
The alias.
avatar
String
The profile photo.
return value
TUIResult
Contains code and message information: code = 0 means the call is successful; code != 0 means the call failed, see message for the reason of failure

call

This API is used to make a (one-to-one) call.
TUICallKit.instance.call('mike', TUICallMediaType.video);

enum TUICallMediaType {
none,
audio,
video
}
The parameters are described below:
Parameter
Type
Description
userId
String
The target user ID.
callMediaType
The call type, which can be video or audio.

groupCall

This API is used to make a group call.
TUICallKit.instance.groupCall('0001', ['denny', 'mike', 'tommy'], TUICallMediaType.video);
The parameters are described below:
Parameter
Type
Description
groupId
String
The group ID.
userIdList
List<String>
The target user IDs.
callMediaType
The call type, which can be video or audio.

joinInGroupCall

This API is used to join a group call.
final roomId = TUIRoomID(intRoomId: 123);
TUICallKit.instance.joinInGroupCall(, ['denny', 'mike', 'tommy'], TUICallMediaType.video);
Parameter
Type
Description
roomId
TUIRoomID
The room ID.
groupId
String
The group ID.
callMediaType
The call type, which can be video or audio.

enableMuteMode

This API is used to set whether to turn on the mute mode.
final enable = true;
TUICallKit.instance..enableMuteMode(enable);
Parameter
Type
Description
enable
Boolean
Turn on and off the mute; true means to turn on the mute

enableFloatWindow

This API is used to set whether to enable floating windows.
final enable = true;
TUICallKit.instance..enableFloatWindow(enable);
Parameter
Type
Description
enable
Boolean
The default value is false, and the floating window button in the top left corner of the call view is hidden. If it is set to true, the button will become visible.