livechat / chat-window-android

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

Cannot add attachment when chat is shown in WebView #24

Closed SzymonGrochowiak closed 4 years ago

SzymonGrochowiak commented 5 years ago

Hi, I have used ChatWindowView by putting it in an XML view. When I receive chat uri, I am redirecting it to WebView in my application using handleUri(uri: Uri?) method.

Here is my WebView configuration:

with(chatWebView.settings) {
    setAppCachePath(cacheDir.path)
    setAppCacheEnabled(true)
    cacheMode = WebSettings.LOAD_DEFAULT
    domStorageEnabled = true
    javaScriptEnabled = true
}
chatWebView.webChromeClient = WebChromeClient()

I have implemented also onStartFilePickerActivity method for the chat listener:

override fun onStartFilePickerActivity(intent: Intent?, requestCode: Int) {
        startActivityForResult(intent, requestCode)
}

Chat works correctly, but the attachment button is grayed out, and there is no action after I click on it.

nomyzs commented 4 years ago

Hey Szymon!

So, from what I learned, the attachment icon is disabled (hidden or grayed out) when chat hasn't been started yet (client hasn't sent his first message).

Have you noticed that? Otherwise, I don't think attachment icon visibility has anything to do with how you decided to implement this chat. However, if this is still a problem, please let me know, I will try to dig deeper. Any tips on reproducing that would be welcomed :)

SzymonGrochowiak commented 4 years ago

Hi, nomyzs. Thank you for your response. I have updated the live chat library to v2.1.2 and attachments seem to work fine. I am closing this issue.