I'm using a WKWebview to display 3D models with Three.js. Calling Javascript functions from B4I is simple with Webview.EvaluateJavaScript and works flawlessly.
It is recommended to use OverrideURL to send messages the other way around from Javascript to B4I. While this works, it is too slow for my use case. I'd like to get the 3D orientation of the model at 60 Hz. In B4A I use warwound's WebViewExtras.addJavascriptInterface for that purpose.
Emme Developer posted a very interesting solution which uses the Webview's userController: WKWebview custom js
This solution works great for sending messages in 'realtime' but the standard events are not raised anymore.
Does anyone have an idea how to use Emme Developer's solution and keep the standard events (most importantly _PageFinished and _JSComplete) at the same time?
I tried to combine the userController with the navigationDelegate from Erel's post here but I couldn't get the events to be raised.
It is recommended to use OverrideURL to send messages the other way around from Javascript to B4I. While this works, it is too slow for my use case. I'd like to get the 3D orientation of the model at 60 Hz. In B4A I use warwound's WebViewExtras.addJavascriptInterface for that purpose.
Emme Developer posted a very interesting solution which uses the Webview's userController: WKWebview custom js
This solution works great for sending messages in 'realtime' but the standard events are not raised anymore.
Does anyone have an idea how to use Emme Developer's solution and keep the standard events (most importantly _PageFinished and _JSComplete) at the same time?
I tried to combine the userController with the navigationDelegate from Erel's post here but I couldn't get the events to be raised.