question background:
1, react.js (not reactnative) do web
2, android webview embed
3, native tune webview internal function does not work
4, ios is normally tunable
react.js Code:
1, constructor initialization binding method
constructor(props){
super(props)
this.initialProgress = this.initialProgress.bind(this)
}
2, componentDidMount window exposure method to native
componentDidMount(){
window.initialProgress = this.initialProgress //
}
3. Method to be executed
initialProgress(){***}
Android executes the initialProgress method:
reference link: how to call back native iOS and Android app in H5 of ReactJS"s JS