From eccdb7a67deab0d7acad9276e24dbca972f2fa2a Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Fri, 19 Jul 2019 14:04:11 +0200 Subject: [PATCH 1/7] Update CustomWebViewManager.java change webview source package name --- .../airship/customwebview/CustomWebViewManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/airship/customwebview/CustomWebViewManager.java b/android/src/main/java/com/airship/customwebview/CustomWebViewManager.java index 62ca23b..21c79cc 100644 --- a/android/src/main/java/com/airship/customwebview/CustomWebViewManager.java +++ b/android/src/main/java/com/airship/customwebview/CustomWebViewManager.java @@ -52,11 +52,11 @@ import com.facebook.react.uimanager.events.ContentSizeChangeEvent; import com.facebook.react.uimanager.events.Event; import com.facebook.react.uimanager.events.EventDispatcher; -import com.facebook.react.views.webview.WebViewConfig; -import com.facebook.react.views.webview.events.TopLoadingErrorEvent; -import com.facebook.react.views.webview.events.TopLoadingFinishEvent; -import com.facebook.react.views.webview.events.TopLoadingStartEvent; -import com.facebook.react.views.webview.events.TopMessageEvent; +import com.reactnativecommunity.webview.WebViewConfig; +import com.reactnativecommunity.webview.events.TopLoadingErrorEvent; +import com.reactnativecommunity.webview.events.TopLoadingFinishEvent; +import com.reactnativecommunity.webview.events.TopLoadingStartEvent; +import com.reactnativecommunity.webview.events.TopMessageEvent; import org.json.JSONObject; import org.json.JSONException; From b773db987643f8beda37d6039269be1485947f36 Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Fri, 19 Jul 2019 14:39:18 +0200 Subject: [PATCH 2/7] try something --- android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/android/build.gradle b/android/build.gradle index 7e61c0c..4171e3d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -36,5 +36,6 @@ repositories { dependencies { compile 'com.facebook.react:react-native:+' + compile 'com.reactnativecommunity:react-native-webview:+' testCompile 'junit:junit:4.12' } From 2c1ea11d0ae29bcbb95e44d47511442a187c724f Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Fri, 19 Jul 2019 16:50:18 +0200 Subject: [PATCH 3/7] add dependency --- android/build.gradle | 2 +- android/settings.gradle | 5 +++++ package-lock.json | 43 +++++++++++++++++++++++++++++++++++++++++ package.json | 5 ++++- 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 android/settings.gradle create mode 100644 package-lock.json diff --git a/android/build.gradle b/android/build.gradle index 4171e3d..6380f5e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -36,6 +36,6 @@ repositories { dependencies { compile 'com.facebook.react:react-native:+' - compile 'com.reactnativecommunity:react-native-webview:+' + implementation(project(':react-native-webview')) testCompile 'junit:junit:4.12' } diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..2c7299c --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,5 @@ +rootProject.name = 'example' +include ':react-native-webview' +project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android') + +include ':app' \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f1b797f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,43 @@ +{ + "name": "react-native-android-fullscreen-webview-video", + "version": "1.0.4", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "react-native-webview": { + "version": "5.12.1", + "resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-5.12.1.tgz", + "integrity": "sha512-pFYzyNUG+k7Jk2a0Z3S1+OL9qtp0VQxVP08d1ume/O6l1Xibi0K0hRZms7zPUHqQc2uWEfjZ0FOa17MIN7vruw==", + "requires": { + "escape-string-regexp": "1.0.5", + "invariant": "2.2.4" + } + } + } +} diff --git a/package.json b/package.json index dd9555f..2c136f2 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,8 @@ "bugs": { "url": "https://github.com/teamairship/react-native-android-fullscreen-webview-video/issues" }, - "homepage": "https://github.com/teamairship/react-native-android-fullscreen-webview-video#readme" + "homepage": "https://github.com/teamairship/react-native-android-fullscreen-webview-video#readme", + "dependencies": { + "react-native-webview": "^5.12.1" + } } From 03c71045b6c6c40c5fd4ce6617c577fa5c73d5cc Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Fri, 19 Jul 2019 16:55:50 +0200 Subject: [PATCH 4/7] do not use settings.gradle --- android/{settings.gradle => __settings.gradle__} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename android/{settings.gradle => __settings.gradle__} (100%) diff --git a/android/settings.gradle b/android/__settings.gradle__ similarity index 100% rename from android/settings.gradle rename to android/__settings.gradle__ From d1c75a0529851d96aa5580e223e4e51c8832da67 Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Fri, 19 Jul 2019 17:00:37 +0200 Subject: [PATCH 5/7] remove unused file --- android/__settings.gradle__ | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 android/__settings.gradle__ diff --git a/android/__settings.gradle__ b/android/__settings.gradle__ deleted file mode 100644 index 2c7299c..0000000 --- a/android/__settings.gradle__ +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = 'example' -include ':react-native-webview' -project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android') - -include ':app' \ No newline at end of file From 8534e092a0f2e9ffc9e6758c0552cb06ff24be2a Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Mon, 22 Jul 2019 15:05:17 +0200 Subject: [PATCH 6/7] fix WebView import for iOS --- iosWebView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iosWebView.js b/iosWebView.js index 032a9c5..271b18b 100644 --- a/iosWebView.js +++ b/iosWebView.js @@ -1,3 +1,3 @@ -import { WebView } from 'react-native'; +import WebView from 'react-native-webview'; export default WebView; From 6b2deae4ec60f08e3613a6f91db2af917803b662 Mon Sep 17 00:00:00 2001 From: Mika Andrianarijaona Date: Thu, 22 Aug 2019 18:05:37 +0200 Subject: [PATCH 7/7] fix UIManager key name --- androidWebView.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/androidWebView.js b/androidWebView.js index 0455d02..2cd8f06 100644 --- a/androidWebView.js +++ b/androidWebView.js @@ -330,7 +330,7 @@ class WebView extends React.Component { goForward = () => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.RCTWebView.Commands.goForward, + UIManager.RNCWebView.Commands.goForward, null ); }; @@ -338,7 +338,7 @@ class WebView extends React.Component { goBack = () => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.RCTWebView.Commands.goBack, + UIManager.RNCWebView.Commands.goBack, null ); }; @@ -349,7 +349,7 @@ class WebView extends React.Component { }); UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.RCTWebView.Commands.reload, + UIManager.RNCWebView.Commands.reload, null ); }; @@ -357,7 +357,7 @@ class WebView extends React.Component { stopLoading = () => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.RCTWebView.Commands.stopLoading, + UIManager.RNCWebView.Commands.stopLoading, null ); }; @@ -365,7 +365,7 @@ class WebView extends React.Component { postMessage = data => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.RCTWebView.Commands.postMessage, + UIManager.RNCWebView.Commands.postMessage, [String(data)] ); }; @@ -379,7 +379,7 @@ class WebView extends React.Component { injectJavaScript = data => { UIManager.dispatchViewManagerCommand( this.getWebViewHandle(), - UIManager.RCTWebView.Commands.injectJavaScript, + UIManager.RNCWebView.Commands.injectJavaScript, [data] ); };