Typing Status

Send typing status#

You can able to send the typing/gone status to the users, so that they can aware of whether user is typing the message or not. if you want send the typing status for a user, you can utilise the below method.

ArgumentTypeDescription
TO_JIDStringjid of the chat user or group
CHAT_TYPEString"chat" for single chat, "groupchat" for group chat

While user starts typing the message in the input box of the chat window, call the below method to send the composing status, so that they can show a typing message in the header/recent chat.

Mirrorfly.sendTypingStatus(toJid: TO_JID, chatType: CHAT_TYPE)

Once user stopped/finished typing the message in the input box of the chat window, call the below method to send the gone status, so that they can hide a typing message in the header/recent chat.

Mirrorfly.sendTypingGoneStatus(toJid: TO_JID, chatType: CHAT_TYPE)

Observe the typing status#

To observe the typing status changes, you can use the below method to setup listener for the typing events.

ArgumentTypeDescription
singleOrgroupJidStringjid of the chat user or Group
userJidStringjid of the chat user of the group
statusStringThe status param will be either composing or Gone
Mirrorfly.typingStatus.listen(result) {
var data = json.decode(event.toString());
var singleOrgroupJid = data["singleOrgroupJid"];
var userJid = data["userJid"];
var typingStatus = data["status"];
}
note

composing means user is typing the message. Gone means user stopped the typing