what is "conversation" in iM.sendIsTypingStateInConversation(conversation, status) in nodejs?
Hello,
I want to initiate typing status from my nodejs application to the recipient. So I used "iM.sendIsTypingStateInConversation(conversation, status)". I am not clear with the parameter "conversation". Could you please explain me how to get this value.
And what is the difference between
"iM.sendIsTypingStateInConversation(conversation, status) "
and
"conversations.sendIsTypingState(conversation, status)"
Thanks and regards,
Sunny
-
Hello Sunny,
You have little description about conversations in doc:
https://hub.openrainbow.net/#/documentation/doc/sdk/node/api/conversations
The API :
"iM.sendIsTypingStateInConversation(conversation, status) "
and
"conversations.sendIsTypingState(conversation, status)"
are same methods.
So a litte sample to set the type state for a peer to peer conversation for a specific user:
let that = this;
let result = that.rainbowSDK.conversations.getConversations();
console.log("getConversations - result : , result, nb conversations : ", result? result.length : 0);
for (let conversation of result) {
if (conversation.type === Conversation.Type.ONE_TO_ONE) {
console.log("conversation ONE_TO_ONE : ", conversation);
if (conversation.contact.lastName === "vincent02") {
that.rainbowSDK.im.sendIsTypingStateInConversation(conversation, true);
}
}
}
}Regards,
Vincent.
Iniciar sesión para dejar un comentario.
Comentarios
2 comentarios