Suggestions

close search

StringeeChat

public class StringeeChat



Represents chat and live chat operations.



Summary


Constructors
Constructor StringeeChat(StringeeClient client)

Creates a StringeeChat instance.

Properties
StreamController<dynamic> eventStreamController

Stream of chat events.

Events
StringeeChatEvents didReceiveObjectChange

Invoked when conversation or message objects change; body is StringeeObjectChange.

Public methods
Future<Map<dynamic, dynamic>> getChatProfile(String key)

Gets chat profile information containing portal info and queue list.

Future<Map<dynamic, dynamic>> getLiveChatToken(String key, String name, String email)

Gets a live chat token for a visitor.

Future<Map<dynamic, dynamic>> updateUserInfo({String? name, String? email, String? avatar, String? phone})

Updates live chat visitor information.

Future<Map<dynamic, dynamic>> createLiveChatConversation(String queueId)

Creates a live chat conversation in a queue.

Future<Map<dynamic, dynamic>> createLiveChatTicket(String key, String name, String email, String description)

Creates a live chat ticket.

Future<Map<dynamic, dynamic>> createConversation(StringeeConversationOption options, List<StringeeUser> participants)

Creates a new conversation.

Future<Map<dynamic, dynamic>> getConversationById(String convId)

Gets a conversation by id.

Future<Map<dynamic, dynamic>> getConversationByUserId(String userId)

Gets a one-to-one conversation by user id from the server.

Future<Map<dynamic, dynamic>> getLocalConversations({String? oaId})

Gets locally cached conversations.

Future<Map<dynamic, dynamic>> getLastConversation(int count, {String? oaId})

Gets the latest conversations from the server.

Future<Map<dynamic, dynamic>> getConversationsBefore(int count, int datetime, {String? oaId})

Gets conversations updated before a timestamp.

Future<Map<dynamic, dynamic>> getConversationsAfter(int count, int datetime, {String? oaId})

Gets conversations updated after a timestamp.

Future<Map<dynamic, dynamic>> clearDb()

Clears the local Stringee database.

Future<Map<dynamic, dynamic>> getTotalUnread()

Gets total unread conversation count.

Future<Map<dynamic, dynamic>> joinOaConversation(String convId)

Joins an OA conversation by conversation id.

void destroy()

Cancels native event subscription and closes the chat event stream.

Constructors


StringeeChat(StringeeClient client)
Creates a StringeeChat instance.

Properties


eventStreamController
Stream of chat events.

Events


didReceiveObjectChange
Invoked when conversation or message objects change; body is StringeeObjectChange.

Public methods


getChatProfile(String key)
Gets chat profile information containing portal info and queue list.
getLiveChatToken(String key, String name, String email)
Gets a live chat token for a visitor.
updateUserInfo({String? name, String? email, String? avatar, String? phone})
Updates live chat visitor information.
createLiveChatConversation(String queueId)
Creates a live chat conversation in a queue.
createLiveChatTicket(String key, String name, String email, String description)
Creates a live chat ticket.
createConversation(StringeeConversationOption options, List<StringeeUser> participants)
Creates a new conversation.
getConversationById(String convId)
Gets a conversation by id.
getConversationByUserId(String userId)
Gets a one-to-one conversation by user id from the server.
getLocalConversations({String? oaId})
Gets locally cached conversations.
getLastConversation(int count, {String? oaId})
Gets the latest conversations from the server.
getConversationsBefore(int count, int datetime, {String? oaId})
Gets conversations updated before a timestamp.
getConversationsAfter(int count, int datetime, {String? oaId})
Gets conversations updated after a timestamp.
clearDb()
Clears the local Stringee database.
getTotalUnread()
Gets total unread conversation count.
joinOaConversation(String convId)
Joins an OA conversation by conversation id.
destroy()
Cancels native event subscription and closes the chat event stream.