Skip to main content

Typing Status

Send Typing Status Message

  1. When a user is typing, send the typing status to the other party.
  2. Only supports one-to-one chat conversation type.

Method


sendTypingStatus(
type: RCIMIWConversationType,
targetId: string,
channelId: string,
currentType: string
): Promise<number>;

Parameter Description

ParameterTypeDescription
typeRCIMIWConversationTypeConversation type
targetIdstringConversation ID
channelIdstringChannel ID, only supported for ultra groups, pass null for other conversation types.
currentTypestringCurrent status

Return Value

Return ValueDescription
numberStatus 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

ParameterTypeDescription
typeRCIMIWConversationTypeConversation type
targetIdstringConversation ID
channelIdstringChannel ID, only supported for ultra groups, pass null for other conversation types.
userTypingStatusArray<RCIMIWTypingStatus>Collection of status changes

RCIMIWTypingStatus Introduction

PropertyTypeDescription
userIdstringID of the user currently typing
contentTypestringMessage type name currently being typed, passed as currentType when the sender calls the send interface
sentTimenumberTyping time

Code Example


engine?.setOnTypingStatusChangedListener(
(
type: RCIMIWConversationType,
targetId: string,
channelId: string,
userTypingStatus: Array<RCIMIWTypingStatus>
) => {
//...
}
);