Untitled

mail@pastecode.io avatar
unknown
java
a year ago
402 B
1
Indexable
Never
private fun sentEventToWebview(jsonSent: String) {
    var urlQuery = convertJsonToString(jsonSent)
    var jsWebView = "window.postMessage({ type: 'JSWebview', data: ${urlQuery} }, '*');"
    webview.evaluateJavascript(jsWebView, object : ValueCallback<String> {
        override fun onReceiveValue(p0: String?) {
            /** Message webview to app  */
            println("p0")
        }
    })
}