Closed Alexander-Ordina closed 1 year ago
Thanks for the PR.
The changes you proposed make sense and solve your problems.
The problem is that we need the baseUrl
to be https in order to make voice recordings work, so webViewController.loadFlutterAsset
is not the solution.
Can you investigate what are the exceptions caused by webViewController.loadHtmlString
?
@bugnano I figured out what was going on: The initialUrl: 'about:blank' was causing the page to load 2 times, first the blank page then the talksJS page if the first one was not finished before the second one started loading then the onPageFinished would not fire for the second page only for the first. This seems to only happen with the webViewController.loadHtmlString() method.
The fix for this was simple, I just removed initialUrl: 'about:blank' since it is not required for webview This way it will only load the one page and the onPageFinished function will fire an excute the required code.
I put the webViewController.loadHtmlString() back so I hope you agree with this fix.
Closing as no longer relevant with InAppWebView
During testing, we encountered a couple of bugs these changes should fix those:
iframe style Added display: block; to the iframe style to prevent whitespace at the end of the iframe, this was causing unwanted scrolling behavior when using the search function.
webViewController.loadFlutterAsset Changed webViewControllerload.HtmlString to webViewController.loadFlutterAsset, loadHtmlString method would often throw a exception I don't know why but using the loadFlutterAsset method solved it.
onUrlNavigation filter for api requests On iOS the navigationDelegate will also be triggered by api requests made by the javascript on the page. To make the behavior the same as Android I've added a filter on these request to make sure that api request (from talkJS) are always allowed.
This will also make sure that a user of the plugin can not prevent the plugin from loading the chat by returning a UrlNavigationAction.deny from onUrlNavigation (Which is how we found out about the issue when we started testing on iOS)