Suggestions

close search

StringeeChat class

Represents a Stringee chat, manages the chat's event. This class provides methods to conversation.


Summary


Constructors
StringeeChat(StringeeClient client)
Properties

eventStreamController → StreamController<dynamic>

Events  

didReceiveObjectChange

Invoked when receive an chat change event.

Methods

createConversation(StringeeConversationOption options, List<User> participants) → result

Create a new StringeeConversation.

getConversationById(String convId) → result

Get the StringeeConversation by conversation id.

getConversationByUserId(String userId) → result

Get the StringeeConversation by user id.

getLocalConversations() → result

Get list of StringeeConversation in local database.

getLastConversation(int count) → result

Get lastest list of StringeeConversation.

getConversationsBefore(int count, int datetime) → result

Get list of StringeeConversation which have updated time smaller than datetime.

getConversationsAfter(int count, int datetime) → result

Get list of StringeeConversation which have updated time greater than datetime.

clearDb() → result

Clear local database.

getTotalUnread() → result

Get count of unread StringeeConversation.

getChatProfile(String key) → result

Get chat profile.

getLiveChatToken(String key, String name, String email) → result

Get live chat token for connecting to Stringee.

updateUserInfo(String name, String email, String avatar) → result

Update user info.

createLiveChatConversation(String queueId) → result

Create a new live chat Conversation.

createLiveChatTicket(String key, String name, String email, String description) → result

Create a live chat ticket.

destroy() → void

Close event stream.

Constructors


StringeeChat(StringeeClient client)
Create a new StringeeChat.

Properties


eventStreamController → StreamController<dynamic>
It's controller of event stream which was sended from plugin.

Events


didReceiveObjectChange
Invoked when receive an chat change event.
Receive StringeeObjectChange from event['body']

Methods


createConversation(ConversationOption options, List<User> participants) → result
Create a new conversation.
If success return created StringeeConversation in result['body'].
getConversationById(String convId) → result
Get the conversation by a conversation id.
If success return StringeeConversation in result['body'].
getConversationByUserId(String token) → result
Get the chat 1-1 conversation with other user by other user's id.
If success return StringeeConversation in result['body'].
getLocalConversations() → result
Get all conversations were saved in local database.
If success List<StringeeConversation> in result['body'].
getLastConversation(int count) → result
Get lastest list of conversations from Stringee server.
If success return List<StringeeConversation> in result['body'].
getConversationsBefore(int count, int datetime) → result
Get list of conversation which have updated time smaller than datetime from Stringee server.
If success return List<StringeeConversation> in result['body'].
getConversationsAfter(int count, int datetime) → result
Get list of conversation which have updated time greater than datetime from Stringee server.
If success return List<StringeeConversation> in result['body'].
clearDb() → result
Clear local database.
getTotalUnread() → result
Get count of unread conversation.
getChatProfile(String key) → result
Get chat profile.
If success return portal info and list queue info in result['body'].
getLiveChatToken(String key, String name, String email) → result
Get live chat token for connecting to Stringee.
If success return token in result['body'].
updateUserInfo(String name, String email, String avatar) → result
Update user info.
createLiveChatConversation(String queueId) → result
Create a new live chat Conversation.
If success return created StringeeConversation in result['body'].
createLiveChatTicket(String key, String name, String email, String description) → result
Create a live chat ticket..
destroy() → void
Close event stream.