Please suggest a way to implement deeplink in webview app
is it available ? any example ?
Hey @amit,
WebView does not provide deep linking support at its core.
But Web App developers can implement it using Javascript bridge to invoke KeplerScript deep linking API.
if you still need this as core feature in webview, please share the use case in which you will need deeplink and implement that in webview.
Thanks,
Rohit
As far as I know, we can inject JavaScript into the webview, and the webapp running inside will be able to see that injected code and check its value. But what I actually want is a way to listen for updates — so whenever the injected JavaScript produces a new value, I can react to it automatically.
Basically, instead of just reading the value once, I need something like an observable stream or an event system (similar to how postMessage works between a webapp and a webview). That way, whenever the kepler app sends new data, I can subscribe and handle it in running app inside webview .
Hi @Amz_Rsk
Following up for next step
Hi @amit ,
Sorry for the delay. Our team has provided the below suggestion.
Let us know if this is helpful.
This is possible using injectJavaScript API. Here is pseudo code
in Kepler app code, first inject JS that contains listener related code,
const auto INJECTED_FUNCTION = "function addDataListener(listener) {
listeners.add(listener);
}
function onDataChanged(data) {
//Propagate the data to all listeners.
}";
webview.injectJavaScript(INJECTED_FUNCTION);
In Web app code , it can start register and listen for data change.
addDataListener(myListener);
In Kepler app, whenever data updated, pass it to web app.
// Construct the data to be passed and call injectJavaScript
webview.injectJavascript("onDataChanged('blah'");
Thanks,
Rohit