Closed ArcherEmiya05 closed 3 years ago
Already fix it by replacing the last else statement
` else {
if (chatWindowListener != null/* && chatWindowListener.handleUri(uri)*/) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
getContext().startActivity(intent);
}
catch (Exception e){
e.printStackTrace();
Toast.makeText(getContext(), "Error : " + e.getMessage(), Toast.LENGTH_SHORT).show();
}
return true;
}
return true;
}`
Hello @ArcherEmiya05 !
Thanks for reaching out and apologies for late response.
Glad you made it work for you!
Looking at your modified piece of code in your update makes me believe that in your case if you just specify your ChatWindowEventsListener and return false
in your overwritten handleUri
method this should work as intended.
Hope this helps
Hello @ArcherEmiya05 !
Thanks for reaching out and apologies for late response. Glad you made it work for you! Looking at your modified piece of code in your update makes me believe that in your case if you just specify your ChatWindowEventsListener and return
false
in your overwrittenhandleUri
method this should work as intended.Hope this helps
Does this mean I can do the same without modifying ChatWindowView.class
file or what I did is the only solution so far?
Yes, you should be able to do the same without modifying this library.
Please note that new version is also available, v2.1.5
being the latest release.
Hoping above helped. Closing this for now, but please open another issue if you still facing this issue or found any others :)
I tried to take a local copy of this project and one thing that our team noticed is that links within the chats can't be automatically open via another browser. We know that it has something to do with
shouldOverrideUrlLoading
inChatWindowView.class
but there is also a methodhandleUri()
. What changes do we need to perform to allow link/uri intents so we can open a link via browser app. We do not want to break the existing logic of thehandleUri()
methods thus we ask for your guidance on this. This also could probably a feature request. We tried to change the code to adding an Intent and returning true onshouldOverrideUrlLoading
but after returning in the app, the LiveChat windows become empty.