If your app minSdkVersion is higher than 17, it is recommended to use the official solution.
Otherwise you can try it.For more information see the wiki
repositories {
// ...
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.dtdream:jsbridge:$latest_version'
}
Listen for the WebViewJavascriptBridgeReady event, ensuring that the "earlier triggered" event takes effect
document.addEventListener('WebViewJavascriptBridgeReady', function() {
//do your work here
},
false
)
This project is licensed under the terms of the MIT license.