livechat / chat-window-android

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

how to show live chat inside ChatWindowView ? #6

Closed mintarasss closed 6 years ago

mintarasss commented 6 years ago

Hello, I don’t know is a bug or my mistake. Maybe same one can help me. I add

maven { url 'https://jitpack.io' }
...
implementation 'com.github.livechat:chat-window-android:v2.0.3'
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

To my project .
In main xml

<com.livechatinc.inappchat.ChatWindowView
    android:id="@+id/embedded_chat_window"
    android:layout_width="match_parent"
    android:layout_height="400dp"/>

In main acitivity

@BindView(R.id.embedded_chat_window)
ChatWindowView leChatWindowView;
...
configuration = new ChatWindowConfiguration("MY-ID",null,null,null, null);
...
public void startEmmbeddedChat() {
    if (!leChatWindowView.isInitialized()) {
        leChatWindowView.setUpWindow(configuration);
        leChatWindowView.setUpListener(this);
        leChatWindowView.initialize();
    }
    leChatWindowView.showChatWindow();
}

on click call startEmmbeddedChat, and this code opens browser, but I need that all be in WebView (ChatWindowView component).

Maybe same one knows how to do that?