Comment on page
Conversation (Chat)
You can view how a chat object can be created for a one-to-one conversation or a group chat with multiple members.
This is called whenever a participant of the conversation starts typing.
chat.onTypingStarted((user) => {
//do something when a user starts typing
})
Response
Field | Type | Description |
---|---|---|
user | the user that started typing |
This is called whenever a participant of the conversation stops typing.
chat.onTypingStopped((user) => {
//do something when a user stops typing
})
Response
Field | Type | Description |
---|---|---|
user | the user that stopped typing |
Get the id of the conversation, returns a
string
const id = chat.getId()
Get the title of the conversation, returns a
string
const title = chat.getTitle()
Get the avatar of the chat, returns a
string
which is the url to the avatarconst avatar = chat.getChatAvatar()
const message = chat.getLastMessage()
const users = await chat.getMembers()
Get an array of ids of all the members of this conversation
const userIds = await chat.getMemberIds()
Call this function to notify everyone who is a participant of the conversation that the current user has started typing
chat.startTyping()
Call this function to notify everyone who is a participant of the conversation that the current user has stopped typing
chat.stopTyping()
Last modified 2mo ago