Kommunicate-io / Kommunicate-Flutter-Plugin

A flutter plugin for Kommunicate customer support live chat.
BSD 3-Clause "New" or "Revised" License
16 stars 23 forks source link

Not able get Chat Conversation based on Bot ID on click on "Start New Conversation" #137

Open AgnelSelvan opened 1 month ago

AgnelSelvan commented 1 month ago

I want to chat with specific bot on Kommunicate, so by passing "conversationAssignee" on going to initial chat screen it worked, but while coming from conversation list to "Start a New Conversation", I was navigated to default Chat Bot on Kommunicate.

Below attached the snippet of our dart code

dynamic user = {
    "userId": "ABC",
    'password': "password",
    "ownerId": "ownerId",
    "Authorization": "Token",
};
dynamic conversationObject = {
    'appId': '<APP_ID>',
    'kmUser': jsonEncode(user),
    "conversationAssignee": '<bot-id>',
     'defaultAssignee':'<bot-id>',
     'botIds': ['<bot-id>',],
    'isSingleConversation': false,
    'skipConversationList': false,
};

await KommunicateFlutterPlugin.updateDefaultSetting(conversationObject);
await KommunicateFlutterPlugin.updateChatContext(user);
var result = await KommunicateFlutterPlugin.buildConversation(conversationObject);

Attached video for your reference

https://github.com/user-attachments/assets/a25940bf-65c6-4d35-875a-7fcdadb06a1a

AgnelSelvan commented 1 month ago

I have fixed this issue by passing defaultAssignee: <bot-id> and skipRouting: true.