Skip to main content

Send typing indicators

Send a typing status

tip
  1. Send a typing indicator to the other party while the user is typing.
  2. Only supported in direct channels.

Method

Dart
Future<int> sendTypingStatus(String typingMessageType)

Parameters

ParameterTypeDescription
typingMessageTypeStringCurrent message type identifier (e.g., 'NC:TxtMsg' for text).

Code example

Dart
final channel = DirectChannel('<target-user-id>');
await channel.sendTypingStatus('NC:TxtMsg');

Listen for typing status changes

Register a ChannelHandler to receive typing status events:

Dart
NCEngine.addChannelHandler('typing-handler', ChannelHandler(
onTypingStatusChanged: (event) {
print(
'Typing status changed in ${event.channelIdentifier.channelId}: ${event.userTypingStatus}',
);
},
));

Remove the handler when it is no longer needed:

Dart
NCEngine.removeChannelHandler('typing-handler');

ChannelUserTypingStatusInfo properties

PropertyTypeDescription
userIdString?User ID of the user currently typing
typingMessageTypeString?Message type identifier (the typingMessageType value passed by the sender)
sentTimeint?Typing timestamp