Properties:
Name | Type | Description |
---|---|---|
EVENT |
Object | |
TYPES |
Object |
Methods
login(options) → {Promise.<any>}
Create Chat SDK instance & login to Chat SDK
Example
let promise = TUIChatEngine.login({
SDKAppID: xxx,
userID: 'xxx',
userSig: 'xxx',
useUploadPlugin: true, // Use file upload plugin
});
promise.then(() => {
// Handle related business logic after successful login
})
Parameters:
Name | Type | Description |
---|---|---|
options |
LoginParams |
Login parameters |
Returns:
- Type
- Promise.<any>
logout() → {Promise.<any>}
Logout from Chat SDK
Example
let promise = TUIChatEngine.logout();
promise.then(() => {
// Handle related business logic after successful logout
})
Returns:
- Type
- Promise.<any>
isReady() → {boolean}
Check if Chat SDK is ready. After SDK is ready, developers can call SDK APIs like sending messages and use various SDK features.
Example
let isReady = TUIChatEngine.isReady();
Returns:
- Type
- boolean
destroy() → {Promise.<any>}
Destroy Chat SDK instance. SDK will logout first, then disconnect WebSocket long connection and release resources.
Example
let promise = TUIChatEngine.destroy();
Returns:
- Type
- Promise.<any>
setLogLevel(level) → {void}
Set SDK log level
Example
TUIChatEngine.setLogLevel(0)
Parameters:
Name | Type | Description |
---|---|---|
level |
number |
Log level
|
Returns:
- Type
- void