typingStatus.startTyping()
Sends a notification to an online user (in 1:1 conversation) or group members (in group conversations) that current user has started typing in a conversation. If counterPartyId
is undefined, take no action.
By default, typing status notices will expire after 8 seconds, at which point the user will no longer appear to be typing. If you want to cancel the typing notice before that time as a result of user action, run client.typingStatus.stopTyping().
When another user in the system starts or stops typing, the typing:change event will be emitted.
Definition
client.typingStatus.startTyping(counterPartyId: string|User|Group|void,{organizationId: string,senderId: ?string}):Promise<void,Error>
Parameters
Parameter | Type | Description |
---|---|---|
counterPartyId | string | User |
options | Object | Options (described below) |
Options
Parameter | Type | Description |
---|---|---|
organizationId | string | The ID of the organization in which the conversation is taking place |
senderId | ?string | If sending as a role, the role that is doing the typing |
Response
Once the returned Promise
is resolved, the typing notification will have been sent to the server.
Example
For a p2p conversation with a user:
await client.typingStatus.startTyping(user.id,{organizationId: conversation.organizationId});
For a group conversation:
await client.typingStatus.startTyping(group.id,{organizationId: conversation.organizationId});