Typing Status
Send Typing Status Message
- When a user is typing, send the typing status to the other party.
- Only supports one-to-one chat conversation type.
Method
sendTypingStatus(
type: RCIMIWConversationType,
targetId: string,
channelId: string,
currentType: string
): Promise<number>;
Parameter Description
Parameter | Type | Description |
---|---|---|
type | RCIMIWConversationType | Conversation type |
targetId | string | Conversation ID |
channelId | string | Channel ID, only supported for ultra groups, pass null for other conversation types. |
currentType | string | Current status |
Return Value
Return Value | Description |
---|---|
number | Status code of the current operation. 0 indicates success, specific results need to be implemented in the interface callback. Non-zero indicates the current operation failed, and the interface callback will not be triggered. Refer to the error codes for details. |
Code Example
let code = await engine.sendTypingStatus(type, targetId, channelId, currentType);
Set Typing Status Listener
Trigger: When the typing users in the current conversation change.
Method
setOnTypingStatusChangedListener(listener?: (type: RCIMIWConversationType, targetId: string, channelId: string, userTypingStatus: Array<RCIMIWTypingStatus>) => void): void;
Parameter Description
Parameter | Type | Description |
---|---|---|
type | RCIMIWConversationType | Conversation type |
targetId | string | Conversation ID |
channelId | string | Channel ID, only supported for ultra groups, pass null for other conversation types. |
userTypingStatus | Array<RCIMIWTypingStatus> | Collection of status changes |
RCIMIWTypingStatus Introduction
Property | Type | Description |
---|---|---|
userId | string | ID of the user currently typing |
contentType | string | Message type name currently being typed, passed as currentType when the sender calls the send interface |
sentTime | number | Typing time |
Code Example
engine?.setOnTypingStatusChangedListener(
(
type: RCIMIWConversationType,
targetId: string,
channelId: string,
userTypingStatus: Array<RCIMIWTypingStatus>
) => {
//...
}
);