fix(onShouldStartLoadWithRequest): android event was missing fields (#385)

`onShouldStartLoadWithRequest` event had only `url` in payload on android.
I've fixed it according to js event definition. 
https://github.com/react-native-community/react-native-webview/blob/master/js/WebViewTypes.js#L34
This commit is contained in:
Stanislav Shakirov
2019-03-13 16:21:25 +01:00
committed by Thibault Malbranche
parent 455e22e3b3
commit a25997bf65
3 changed files with 34 additions and 43 deletions
@@ -159,7 +159,11 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
dispatchEvent(view, new TopShouldStartLoadWithRequestEvent(view.getId(), url));
dispatchEvent(
view,
new TopShouldStartLoadWithRequestEvent(
view.getId(),
createWebViewEvent(view, url)));
return true;
}
@@ -167,8 +171,8 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
dispatchEvent(view, new TopShouldStartLoadWithRequestEvent(view.getId(), request.getUrl().toString()));
return true;
final String url = request.getUrl().toString();
return this.shouldOverrideUrlLoading(view, url);
}
@Override