diff --git a/android/app/src/main/java/io/cozy/flagship/mobile/webview/IndexInjectionWebViewManager.java b/android/app/src/main/java/io/cozy/flagship/mobile/webview/IndexInjectionWebViewManager.java index 57b05909b..51f29749e 100644 --- a/android/app/src/main/java/io/cozy/flagship/mobile/webview/IndexInjectionWebViewManager.java +++ b/android/app/src/main/java/io/cozy/flagship/mobile/webview/IndexInjectionWebViewManager.java @@ -11,7 +11,10 @@ import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.annotations.ReactProp; +import com.reactnativecommunity.webview.RNCWebView; +import com.reactnativecommunity.webview.RNCWebViewClient; import com.reactnativecommunity.webview.RNCWebViewManager; +import com.reactnativecommunity.webview.RNCWebViewWrapper; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -33,8 +36,8 @@ public class IndexInjectionWebViewManager extends RNCWebViewManager { private static final String TAG = "IndexInjectionWebView"; @Override - protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) { - return new IndexInjectionWebView(reactContext); + public RNCWebViewWrapper createViewInstance(ThemedReactContext reactContext) { + return super.createViewInstance(reactContext, new IndexInjectionWebView(reactContext)); } @Override @@ -43,13 +46,13 @@ public String getName() { } @Override - protected void addEventEmitters(ThemedReactContext reactContext, WebView view) { - view.setWebViewClient(new IndexInjectionWebViewClient()); + protected void addEventEmitters(ThemedReactContext reactContext, RNCWebViewWrapper view) { + view.getWebView().setWebViewClient(new IndexInjectionWebViewClient()); } @ReactProp(name = "injectedIndex") - public void setInjectedIndex(WebView view, String url) { - ((IndexInjectionWebView) view).setInjectedIndex(url); + public void setInjectedIndex(RNCWebViewWrapper view, String url) { + ((IndexInjectionWebView) view.getWebView()).setInjectedIndex(url); } protected static class IndexInjectionWebViewClient extends RNCWebViewClient { @@ -78,8 +81,7 @@ public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceReque } protected static class IndexInjectionWebView extends RNCWebView { - protected @Nullable - String mInjectedIndex; + protected @Nullable String mInjectedIndex; public IndexInjectionWebView(ThemedReactContext reactContext) { super(reactContext); diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 210cccf67..061f19fbb 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -527,7 +527,8 @@ PODS: - react-native-slider (4.4.4): - RCT-Folly (= 2021.07.22.00) - React-Core - - react-native-webview (11.18.2): + - react-native-webview (13.13.1): + - RCT-Folly (= 2021.07.22.00) - React-Core - React-NativeModulesApple (0.72.12): - hermes-engine @@ -1096,7 +1097,7 @@ SPEC CHECKSUMS: react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162 react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc react-native-slider: 2a78c87e19a8b2b9837037fcb68dce4be73e335a - react-native-webview: 8ec7ddf9eb4ddcd92b32cee7907efec19a9ec7cb + react-native-webview: 93adcfce70194c3d7aaf178c0c6e7934c2e22960 React-NativeModulesApple: 694679e4193a49c09f0a76ee27ec09b2c466d59c React-perflogger: 63606aeab27683112e1bd4ef25bd099ec1cb03f8 React-RCTActionSheet: 5b39fc2b479d47325e5ac95193c482044bfebbc6 diff --git a/package.json b/package.json index bf952da2c..bcff43681 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "react-native-svg": "13.14.0", "react-native-toast-message": "2.1.6", "react-native-url-polyfill": "^1.3.0", - "react-native-webview": "github:cozy/react-native-webview#1.0.3", + "react-native-webview": "^13.13.1", "react-redux": "^8.0.5", "react-scripts": "4.0.3", "redux-logger": "3.0.6", diff --git a/yarn.lock b/yarn.lock index cedaa8ef6..01808462e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16839,11 +16839,12 @@ react-native-url-polyfill@^1.3.0: dependencies: whatwg-url-without-unicode "8.0.0-3" -"react-native-webview@github:cozy/react-native-webview#1.0.3": - version "11.18.2" - resolved "https://codeload.github.com/cozy/react-native-webview/tar.gz/622fae7bb357a2d1ab25bf46bafdf821780b4b4b" +react-native-webview@^13.13.1: + version "13.13.1" + resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-13.13.1.tgz#a016557afc02126175f151caaed545abbdef4eb2" + integrity sha512-Qwrvdwl2U2bG8QlghfRzGR/PCwKzW/cXTCR/WfMWHeGoADp2CHuCaEpfYO/HhlLLGy3Jqizsy+sjFhnKa1AgrA== dependencies: - escape-string-regexp "2.0.0" + escape-string-regexp "^4.0.0" invariant "2.2.4" react-native@0.72.12: