livechat / chat-window-android

LiveChat mobile chat window for Android
https://developers.livechatinc.com/mobile/android/
MIT License
23 stars 28 forks source link

Chat history not retained when launching from a new Activity using same/new ChatWindowConfiguration instance. #20

Closed akvivekrai closed 3 years ago

akvivekrai commented 5 years ago

I've chat icon on 3 different (Activity) screens in my app. If I have started a chat on one of these screens, and then go to another screen and launch chat there, it starts a fresh chat again and doesn't show my ongoing chat from the previous screen. Unable to figure out how to retain chat history from one (Activity)screen to another. I have tried reusing same ChatWindowConfiguration instance each time but no luck.

I am using full screen window as mentioned in https://developers.livechatinc.com/docs/android-widget/#full-screen-window

SAMPLE CODE:

ChatWindowView initializeFullScreenChat(Activity activity, ChatWindowView.ChatWindowEventsListener chatListener) {
        final ChatWindowConfiguration configuration = new ChatWindowConfiguration("licenseNumber", "random_group_id", null, null, null);

        ChatWindowView fullScreenChatWindow = ChatWindowView.createAndAttachChatWindowInstance(activity);
        fullScreenChatWindow.setUpWindow(configuration);
        fullScreenChatWindow.setUpListener(chatListener);
        fullScreenChatWindow.initialize();

        return fullScreenChatWindow;
    }
nomyzs commented 4 years ago

Hello @akvivekrai

Which version of the widget are you using? Chat should retain its state, no matter how it's embedded since the 2.0.4 version. I wasn't able to reproduce it with the example app, so any tips on that would be appreciated :)