Suggestions

close search

StringeeConversation class

Represents a conversation.


Properties


id → String?

It's the unique identification of the conversation on Stringee system.

localId → String?

It's the unique identification of the conversation on local database.

name → String?

It's name of the conversation.

isGroup → bool

Whether the conversation is a group chat:

creator → String?

It's the unique identification of the participant create the conversation.

totalUnread → int?

It's number of unread messages in the conversation.

updatedAt → int?

It's last time when update the conversation.

createdAt → int?

It's time when create the conversation.

lastMsg → StringeeMessage?

It's last message of the conversation.

pinnedMsgId → String?

It's pined message's id.

participants → List<StringeeUser>?

It's list of participants.

customData → String?

It's custom data of the conversation.

lastTimeNewMsg → int?

It is the time of the last new message which you received in the conversation.

lastMsgSeqReceived → int?

It is the sequence of the last new message which you received in the conversation.

channelType → ChannelType?

It's channel type of the conversation.

ended → bool?

Whether the conversation is ended:

lastSequence → int?

It's the sequence of the last message in the conversation.


Methods


sendMessage(StringeeMessage message) → Map<dynamic, dynamic>

Send a message.

getMessages(List msgIds) → Map<dynamic, dynamic>

Get list of messages of conversation by message's id. If successful return a list of StringeeMessage in callBack['body'].

getLocalMessages(int count) → Map<dynamic, dynamic>

Get list of local messages of conversation by message's id. If successful return a list of StringeeMessage in callBack['body'].

getLastMessages(int count, {bool? loadDeletedMsg, bool? loadDeletedMsgContent, bool? loadAll}) → Map<dynamic, dynamic>

Get list of last messages of conversation by message's id. If successful return a list of StringeeMessage in callBack['body'].

getMessagesAfter(int count, int sequence, {bool? loadDeletedMsg, bool? loadDeletedMsgContent, bool? loadAll}) → Map<dynamic, dynamic>

Get list of messages which have sequence smaller than seq. If successful return a list of StringeeMessage in callBack['body'].

getMessagesBefore(int count, int sequence, {bool? loadDeletedMsg, bool? loadDeletedMsgContent, bool? loadAll}) → Map<dynamic, dynamic>

Get list of messages which have sequence greater than seq. If successful return a list of StringeeMessage in callBack['body'].

getAttachmentMessages(int count, int start, MsgType msgType) → Map<dynamic, dynamic>

Get list of attachment messages by attachment type. If successful return a list of StringeeMessage in callBack['body'].

updateConversation(String name, {String? avatar}) → Map<dynamic, dynamic>

Update conversation name, avatar.

setRole(String userId, UserRole role) → Map<dynamic, dynamic>

Set role for participant in the conversation.

deleteMessages(List msgIds) → Map<dynamic, dynamic>

Delete messages by message's id.

revokeMessages(List msgIds, bool isDeleted) → Map<dynamic, dynamic>

Revoke messages by message's id.

markAsRead() → Map<dynamic, dynamic>

Mark the conversation's messages as read.

rateChat(Rating rating, {String? comment}) → Map<dynamic, dynamic>

Rate the the support conversation.

transferTo(String userId, String customerId, String customerName) → Map<dynamic, dynamic>

Transfer the support conversation to userId.

continueChatting() → Map<dynamic, dynamic>

Continue the support conversation.

sendChatTranscript(String email, String domain) → Map<dynamic, dynamic>

Send chat transcript.

endChat() → Map<dynamic, dynamic>

End the support conversation.

beginTyping() → Map<dynamic, dynamic>

Send begin typing.

endTyping() → Map<dynamic, dynamic>

Send end typing.

delete() → Map<dynamic, dynamic>

Delete the conversation.

addParticipants(List<StringeeUser> participants) → Map<dynamic, dynamic>

Add participants to conversation. If successful return a list of added StringeeUser in callBack['body'].

removeParticipants(List<StringeeUser> participants) → Map<dynamic, dynamic>

Remove participants from conversation. If successful return a list of removed StringeeUser in callBack['body'].