agent_chat_service 0.0.4 agent_chat_service: ^0.0.4 copied to clipboard
Chat Service is used to integrate as agent support for your Flutter App Customers.
The package is used to give a support or guidence to your customer.
It supports for both Mobile and web.
Features: #
- chat support.
- Currently available only messages support.
- Supported for both Android and IOS.
- And also web and Desktop(All).
How to use #
-
Initialize the api_key in main() function.
-
Login to Innostack web and generate the api_key.
-
It checks the user(who is using package) is registered or not and his premium status.
void main() { ChatApiService.initApiKey("api_key"); runApp(const MyApp()); }
-
Use the below code to display ChatScreen
AgentChatScreen( agentId: agentId, screenTitle: "Your App Name", chatSession: chatsession, onTyping: (bool) { // Your code to update user status of typing as boolean }, onSendMessage: (message) { /* When send a message in the screen it will return a message as Message( messageId : "32bit uid", senderId: "customerId", read: false, senderType: SenderType.customer, messageText: "your text", createdAt: DateTime.now()); Now you have to set sessionId to message message.sessionId = sessionId; write code to upload message to server. */ }, appBarColor: Colors.red,(Optional) bodyColor: Colors.grey,(Optional) messageTileColor: Colors.white.withOpacity(0.3),(Optional) );