Closed iamarkdev closed 6 years ago
Thanks @lucasferreira could you bump the npm version as well and publish it?
OK @braydo25 thanks for that ;)
Couldn't test at all, but I've merged this believing in your need and already published in npm.
Great! All should be well - I did extensive testing prior to submitting the PR
Have any solution to solve this issue? I did check latest version but didn't any update for this issue.
It's already published @sinhpn92
https://github.com/lucasferreira/react-native-webview-android/blob/master/index.android.js#L46
This adds a solution to react-native-webview-android for onShouldStartLoadWithRequest support.
The approach is fairly straightforward.
For any URL load, shouldOverrideUrlLoading will initially return true - not allowing it to load. It will also dispatch the ShouldOverrideUrlLoadingEvent, triggering _onShouldOverrideUrlLoading in index.android.js. It then gets the result of onShouldStartLoadWithRequest at the react-native level if it's set on RNWebViewAndroid. A view manager command is sent back to the native side, which will take the onShouldStartLoadWithRequest result as shouldOverride included in the command and either allow the original url to load, or not load.
To note, onShouldStartLoadWithRequest only receives an object containing
url
andnavigationState
in this initial implementation.