Просмотр исходного кода

Merge branch 'master' of github.com:react-native-community/react-native-webview

Erik Haider Forsén 4 лет назад
Родитель
Сommit
6fe5fc8878
99 измененных файлов: 17419 добавлений и 14150 удалений
  1. 1
    1
      .circleci/config.yml
  2. 12
    0
      .gitattributes
  3. 1
    1
      .github/workflows/detox.yml
  4. 108
    0
      .github/workflows/scripts/install-vs-features.ps1
  5. 67
    0
      .github/workflows/windows-ci.yml
  6. 2
    0
      .gitignore
  7. 1
    1
      README.md
  8. 31
    0
      __tests__/Alert.test.js
  9. 23
    14
      android/build.gradle
  10. 2
    2
      android/gradle.properties
  11. 225
    13
      android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java
  12. 152
    71
      android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java
  13. 0
    0
      apple/RNCWKProcessPoolManager.h
  14. 0
    0
      apple/RNCWKProcessPoolManager.m
  15. 2
    0
      apple/RNCWebView.h
  16. 92
    19
      apple/RNCWebView.m
  17. 0
    0
      apple/RNCWebViewManager.h
  18. 2
    0
      apple/RNCWebViewManager.m
  19. 1
    1
      docs/Custom-Android.md
  20. 5
    11
      docs/Getting-Started.md
  21. 45
    14
      docs/Guide.md
  22. 5
    1
      docs/README.portuguese.md
  23. 141
    80
      docs/Reference.md
  24. 28
    0
      example/App.tsx
  25. 7
    0
      example/android/app/src/main/java/com/example/MainApplication.java
  26. 4
    4
      example/android/build.gradle
  27. 1
    1
      example/android/gradle/wrapper/gradle-wrapper.properties
  28. 2
    2
      example/android/gradlew
  29. 100
    100
      example/android/gradlew.bat
  30. 9
    0
      example/assets/test.html
  31. 55
    0
      example/examples/Downloads.tsx
  32. 28
    27
      example/examples/Injection.tsx
  33. 16
    0
      example/examples/LocalPageLoad.tsx
  34. 6
    6
      example/ios/Podfile
  35. 181
    157
      example/ios/Podfile.lock
  36. 11
    7
      example/ios/example.xcodeproj/project.pbxproj
  37. 2
    43
      example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme
  38. 2
    43
      example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme
  39. 42
    0
      example/macos/Podfile
  40. 199
    0
      example/macos/Podfile.lock
  41. 0
    7
      example/macos/example-iOS/AppDelegate.h
  42. 0
    7
      example/macos/example-iOS/AppDelegate.m
  43. 0
    0
      example/macos/example-iOS/Base.lproj/LaunchScreen.xib
  44. 0
    15
      example/macos/example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json
  45. 0
    0
      example/macos/example-iOS/Images.xcassets/Contents.json
  46. 1
    1
      example/macos/example-iOS/Info.plist
  47. 0
    7
      example/macos/example-iOS/main.m
  48. 0
    7
      example/macos/example-macOS/AppDelegate.h
  49. 0
    7
      example/macos/example-macOS/AppDelegate.m
  50. 58
    0
      example/macos/example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json
  51. 6
    0
      example/macos/example-macOS/Assets.xcassets/Contents.json
  52. 25
    21
      example/macos/example-macOS/Base.lproj/Main.storyboard
  53. 17
    15
      example/macos/example-macOS/Info.plist
  54. 0
    7
      example/macos/example-macOS/ViewController.h
  55. 0
    7
      example/macos/example-macOS/ViewController.m
  56. 12
    0
      example/macos/example-macOS/example.entitlements
  57. 0
    7
      example/macos/example-macOS/main.m
  58. 606
    1569
      example/macos/example.xcodeproj/project.pbxproj
  59. 5
    19
      example/macos/example.xcodeproj/xcshareddata/xcschemes/example-iOS.xcscheme
  60. 8
    22
      example/macos/example.xcodeproj/xcshareddata/xcschemes/example-macOS.xcscheme
  61. 10
    0
      example/macos/example.xcworkspace/contents.xcworkspacedata
  62. 2
    4
      example/macos/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  63. 1
    0
      example/windows/.gitignore
  64. 1
    0
      example/windows/WebViewWindows.sln
  65. 0
    5
      example/windows/WebViewWindows/App.cpp
  66. 1
    1
      example/windows/WebViewWindows/Package.appxmanifest
  67. 5
    4
      example/windows/WebViewWindows/WebViewWindows.vcxproj
  68. 1
    0
      example/windows/WebViewWindows/WebViewWindows.vcxproj.filters
  69. 24
    24
      example/windows/WebViewWindows/pch.h
  70. 1
    1
      index.d.ts
  71. 7
    7
      ios/RNCWebView.xcodeproj/project.pbxproj
  72. 12
    0
      jest-setups/jest.setup.js
  73. 1
    0
      jest-setups/jest.setup.windows.js
  74. 24
    24
      macos/RNCWebView.xcodeproj/project.pbxproj
  75. 91
    86
      package.json
  76. 2
    2
      react-native-webview.podspec
  77. 14
    0
      react-native.config.js
  78. 15
    0
      src/WebView.android.tsx
  79. 1
    0
      src/WebView.ios.tsx
  80. 18
    3
      src/WebView.tsx
  81. 266
    258
      src/WebView.windows.tsx
  82. 52
    0
      src/WebViewTypes.ts
  83. 204
    204
      windows/ReactNativeWebView.sln
  84. 15
    15
      windows/ReactNativeWebView/PropertySheet.props
  85. 3
    3
      windows/ReactNativeWebView/ReactNativeWebView.def
  86. 32
    32
      windows/ReactNativeWebView/ReactNativeWebView.filters
  87. 159
    161
      windows/ReactNativeWebView/ReactNativeWebView.vcxproj
  88. 17
    17
      windows/ReactNativeWebView/ReactPackageProvider.cpp
  89. 20
    20
      windows/ReactNativeWebView/ReactPackageProvider.h
  90. 7
    7
      windows/ReactNativeWebView/ReactPackageProvider.idl
  91. 147
    143
      windows/ReactNativeWebView/ReactWebView.cpp
  92. 36
    35
      windows/ReactNativeWebView/ReactWebView.h
  93. 7
    6
      windows/ReactNativeWebView/ReactWebView.idl
  94. 144
    143
      windows/ReactNativeWebView/ReactWebViewManager.cpp
  95. 2
    4
      windows/ReactNativeWebView/ReactWebViewManager.h
  96. 3
    3
      windows/ReactNativeWebView/packages.config
  97. 1
    1
      windows/ReactNativeWebView/pch.cpp
  98. 13
    13
      windows/ReactNativeWebView/pch.h
  99. 13711
    10587
      yarn.lock

+ 1
- 1
.circleci/config.yml Просмотреть файл

34
             - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
34
             - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
35
 
35
 
36
       - run:
36
       - run:
37
-          name: Run Tests
37
+          name: Lint checks
38
           command: yarn ci
38
           command: yarn ci
39
 
39
 
40
   publish:
40
   publish:

+ 12
- 0
.gitattributes Просмотреть файл

1
+* text=auto
2
+
3
+*.bat text eol=crlf
4
+*.def text eol=crlf
5
+*.filters text eol=crlf
6
+*.idl text eol=crlf
7
+*.props text eol=crlf
8
+*.ps1 text eol=crlf 
9
+*.sln text eol=crlf
10
+*.vcxproj text eol=crlf
11
+*.xaml text eol=crlf
12
+

+ 1
- 1
.github/workflows/detox.yml Просмотреть файл

1
 name: 'Detox CI Tests'
1
 name: 'Detox CI Tests'
2
-on: [push]
2
+on: [pull_request]
3
 
3
 
4
 jobs:
4
 jobs:
5
   tests:
5
   tests:

+ 108
- 0
.github/workflows/scripts/install-vs-features.ps1 Просмотреть файл

1
+param (
2
+	[Parameter(Mandatory=$true)]
3
+	[string[]] $Components,
4
+
5
+	[uri] $InstallerUri = "https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe",
6
+
7
+	[string] $VsInstaller = "${env:System_DefaultWorkingDirectory}\vs_Enterprise.exe",
8
+
9
+	[string] $VsInstallOutputDir = "${env:System_DefaultWorkingDirectory}\vs",
10
+
11
+	[System.IO.FileInfo] $VsInstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise",
12
+
13
+	[System.IO.FileInfo] $VsInstallerPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer",
14
+
15
+	[switch] $Collect = $false,
16
+
17
+	[switch] $Cleanup = $false,
18
+
19
+	[switch] $UseWebInstaller = $false
20
+)
21
+
22
+$Components | ForEach-Object {
23
+	$componentList += '--add', $_
24
+}
25
+
26
+$LocalVsInstaller = "$VsInstallerPath\vs_installershell.exe"
27
+
28
+$UseWebInstaller = $UseWebInstaller -or -not (Test-Path -Path "$LocalVsInstaller")
29
+
30
+if ($UseWebInstaller) {
31
+	Write-Host "Downloading web installer..."
32
+
33
+	Invoke-WebRequest -Method Get `
34
+		-Uri $InstallerUri `
35
+		-OutFile $VsInstaller
36
+
37
+	New-Item -ItemType directory -Path $VsInstallOutputDir
38
+
39
+	Write-Host "Running web installer to download requested components..."
40
+
41
+	Start-Process `
42
+		-FilePath "$VsInstaller" `
43
+		-ArgumentList ( `
44
+			'--layout', "$VsInstallOutputDir",
45
+			'--wait',
46
+			'--norestart',
47
+			'--quiet' + `
48
+			$componentList
49
+		) `
50
+		-Wait `
51
+		-PassThru
52
+
53
+	Write-Host "Running downloaded VS installer to add requested components..."
54
+
55
+	Start-Process `
56
+		-FilePath "$VsInstallOutputDir\vs_Enterprise.exe" `
57
+		-ArgumentList (
58
+			'modify',
59
+			'--installPath', "`"$VsInstallPath`"" ,
60
+			'--wait',
61
+			'--norestart',
62
+			'--quiet' + `
63
+			$componentList
64
+		) `
65
+		-Wait `
66
+		-PassThru `
67
+		-OutVariable returnCode
68
+
69
+	if ($Cleanup) {
70
+		Write-Host "Cleaning up..."
71
+
72
+		Remove-Item -Path $VsInstaller
73
+		Remove-Item -Path $VsInstallOutputDir -Recurse
74
+	}
75
+	
76
+} else {
77
+	Write-Host "Running local installer to add requested components..."
78
+
79
+	Start-Process `
80
+		-FilePath "$LocalVsInstaller" `
81
+		-ArgumentList (
82
+			'modify',
83
+			'--installPath', "`"$VsInstallPath`"" ,
84
+			'--norestart',
85
+			'--quiet' + `
86
+			$componentList
87
+		) `
88
+		-Wait `
89
+		-OutVariable returnCode
90
+}
91
+
92
+if ($Collect) {
93
+	Invoke-WebRequest -Method Get `
94
+		-Uri 'https://download.microsoft.com/download/8/3/4/834E83F6-C377-4DCE-A757-69A418B6C6DF/Collect.exe' `
95
+		-OutFile ${env:System_DefaultWorkingDirectory}\Collect.exe
96
+
97
+	# Should generate ${env:Temp}\vslogs.zip
98
+	Start-Process `
99
+		-FilePath "${env:System_DefaultWorkingDirectory}\Collect.exe" `
100
+		-Wait `
101
+		-PassThru
102
+
103
+	New-Item -ItemType Directory -Force ${env:System_DefaultWorkingDirectory}\vslogs
104
+	Expand-Archive -Path ${env:TEMP}\vslogs.zip -DestinationPath ${env:System_DefaultWorkingDirectory}\vslogs\
105
+
106
+	Write-Host "VC versions after installation:"
107
+	Get-ChildItem -Name "$VsInstallPath\VC\Tools\MSVC\"
108
+}

+ 67
- 0
.github/workflows/windows-ci.yml Просмотреть файл

1
+name: Windows CI
2
+on: [pull_request]
3
+
4
+jobs:
5
+  run-windows-tests:
6
+    name: Build & run tests
7
+    runs-on: windows-2019
8
+
9
+    steps:
10
+    - uses: actions/checkout@v2
11
+      name: Checkout Code
12
+     
13
+    - name: Setup Node.js
14
+      uses: actions/setup-node@v1
15
+      with:
16
+        node-version: '12.9.1'
17
+
18
+    - name: Install Visual Studio components
19
+      shell: powershell
20
+      run: .\.github\workflows\scripts\install-vs-features.ps1 Microsoft.VisualStudio.Component.VC.v141.x86.x64,Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141
21
+
22
+    - name: Setup MSBuild
23
+      uses: microsoft/setup-msbuild@v1.0.0
24
+      with:
25
+        vs-version: 16.5
26
+       
27
+    - name: Setup NuGet
28
+      uses: NuGet/setup-nuget@v1.0.2
29
+
30
+    - name: Check node modules cache
31
+      uses: actions/cache@v1
32
+      id: yarn-cache
33
+      with:
34
+        path: ./node_modules
35
+        key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
36
+        restore-keys: |
37
+          ${{ runner.os }}-yarn-
38
+
39
+    - name: Install node modules
40
+      if: steps.yarn-cache.outputs.cache-hit != 'true'
41
+      run: yarn --pure-lockfile
42
+    
43
+    - name: yarn build
44
+      if: steps.yarn-cache.outputs.cache-hit == 'true'
45
+      run: |
46
+        yarn build
47
+        yarn tsc
48
+ 
49
+    - name: NuGet restore
50
+      run: nuget restore example\windows\WebViewWindows.sln
51
+
52
+    - name: Build x64 release
53
+      run: msbuild example\windows\WebViewWindows.sln /p:Configuration=Release /p:Platform=x64 -m
54
+
55
+    - name: Deploy
56
+      shell: powershell
57
+      run: |
58
+        cd example
59
+        Copy-Item -Path windows\x64\Release -Recurse -Destination windows\
60
+        npx react-native run-windows --arch x64 --release --no-build --no-packager
61
+
62
+    - name: Start Appium server
63
+      shell: powershell
64
+      run: Start-Process PowerShell -ArgumentList "yarn appium"
65
+      
66
+    - name: Run tests
67
+      run: yarn test:windows

+ 2
- 0
.gitignore Просмотреть файл

57
 .classpath
57
 .classpath
58
 .project
58
 .project
59
 .settings/
59
 .settings/
60
+msbuild.binlog
61
+example/msbuild.binlog

+ 1
- 1
README.md Просмотреть файл

97
 
97
 
98
 MIT
98
 MIT
99
 
99
 
100
-## Traduções
100
+## Translations
101
 
101
 
102
 This readme is available in:
102
 This readme is available in:
103
 
103
 

+ 31
- 0
__tests__/Alert.test.js Просмотреть файл

1
+/**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+import { driver, By2 } from 'selenium-appium'
7
+import { until } from 'selenium-webdriver';
8
+
9
+const setup = require('../jest-setups/jest.setup');
10
+jest.setTimeout(50000);
11
+
12
+beforeAll(() => {
13
+  return driver.startWithCapabilities(setup.capabilites);
14
+});
15
+
16
+afterAll(() => {
17
+  return driver.quit();
18
+});
19
+
20
+describe('Alert Tests', () => {
21
+  
22
+  test('Show Alert', async () => {
23
+    const showAlertButton = await driver.wait(until.elementLocated(By2.nativeName('Show alert')));
24
+    await showAlertButton.click();
25
+    await driver.wait(until.elementLocated(By2.nativeName('Hello! I am an alert box!')));
26
+    await By2.nativeName('OK').click();
27
+    const dismissMessage = await driver.wait(until.elementLocated(By2.nativeName('Alert dismissed!')));
28
+    expect(dismissMessage).not.toBeNull();
29
+  });
30
+
31
+});

+ 23
- 14
android/build.gradle Просмотреть файл

1
 buildscript {
1
 buildscript {
2
-  //Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
-  def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeWebView_kotlinVersion']
4
-
5
-  repositories {
6
-    google()
7
-    jcenter()
2
+  ext.getExtOrDefault = {name ->
3
+    return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
8
   }
4
   }
9
 
5
 
10
-  dependencies {
11
-    classpath 'com.android.tools.build:gradle:3.2.1'
12
-    //noinspection DifferentKotlinGradleVersion
13
-    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14
-  }
15
-}
6
+  // The Android Gradle plugin is only required when opening the android folder stand-alone.
7
+  // This avoids unnecessary downloads and potential conflicts when the library is included as a
8
+  // module dependency in an application project.
9
+  if (project == rootProject) {
10
+    repositories {
11
+      google()
12
+      jcenter()
13
+    }
14
+
15
+    dependencies {
16
+      classpath("com.android.tools.build:gradle:3.6.0")
17
+      classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
18
+    }
19
+  } else {
20
+    repositories {
21
+      jcenter()
22
+    }
16
 
23
 
17
-def getExtOrDefault(name) {
18
-  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
24
+    dependencies {
25
+      classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
26
+    }
27
+  }
19
 }
28
 }
20
 
29
 
21
 def getExtOrIntegerDefault(name) {
30
 def getExtOrIntegerDefault(name) {

+ 2
- 2
android/gradle.properties Просмотреть файл

1
 ReactNativeWebView_kotlinVersion=1.3.50
1
 ReactNativeWebView_kotlinVersion=1.3.50
2
-ReactNativeWebView_compileSdkVersion=28
3
-ReactNativeWebView_buildToolsVersion=28.0.3
2
+ReactNativeWebView_compileSdkVersion=29
3
+ReactNativeWebView_buildToolsVersion=29.0.3
4
 ReactNativeWebView_targetSdkVersion=28
4
 ReactNativeWebView_targetSdkVersion=28

+ 225
- 13
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java Просмотреть файл

10
 import android.graphics.Bitmap;
10
 import android.graphics.Bitmap;
11
 import android.graphics.Color;
11
 import android.graphics.Color;
12
 import android.Manifest;
12
 import android.Manifest;
13
+import android.net.http.SslError;
13
 import android.net.Uri;
14
 import android.net.Uri;
14
 import android.os.Build;
15
 import android.os.Build;
15
 import android.os.Environment;
16
 import android.os.Environment;
26
 import android.webkit.DownloadListener;
27
 import android.webkit.DownloadListener;
27
 import android.webkit.GeolocationPermissions;
28
 import android.webkit.GeolocationPermissions;
28
 import android.webkit.JavascriptInterface;
29
 import android.webkit.JavascriptInterface;
30
+import android.webkit.SslErrorHandler;
29
 import android.webkit.PermissionRequest;
31
 import android.webkit.PermissionRequest;
30
 import android.webkit.URLUtil;
32
 import android.webkit.URLUtil;
31
 import android.webkit.ValueCallback;
33
 import android.webkit.ValueCallback;
41
 import com.facebook.react.views.scroll.ScrollEventType;
43
 import com.facebook.react.views.scroll.ScrollEventType;
42
 import com.facebook.react.views.scroll.OnScrollDispatchHelper;
44
 import com.facebook.react.views.scroll.OnScrollDispatchHelper;
43
 import com.facebook.react.bridge.Arguments;
45
 import com.facebook.react.bridge.Arguments;
46
+import com.facebook.react.bridge.CatalystInstance;
44
 import com.facebook.react.bridge.LifecycleEventListener;
47
 import com.facebook.react.bridge.LifecycleEventListener;
45
 import com.facebook.react.bridge.ReactContext;
48
 import com.facebook.react.bridge.ReactContext;
46
 import com.facebook.react.bridge.ReadableArray;
49
 import com.facebook.react.bridge.ReadableArray;
47
 import com.facebook.react.bridge.ReadableMap;
50
 import com.facebook.react.bridge.ReadableMap;
48
 import com.facebook.react.bridge.ReadableMapKeySetIterator;
51
 import com.facebook.react.bridge.ReadableMapKeySetIterator;
49
 import com.facebook.react.bridge.WritableMap;
52
 import com.facebook.react.bridge.WritableMap;
53
+import com.facebook.react.bridge.WritableNativeArray;
54
+import com.facebook.react.bridge.WritableNativeMap;
50
 import com.facebook.react.common.MapBuilder;
55
 import com.facebook.react.common.MapBuilder;
51
 import com.facebook.react.common.build.ReactBuildConfig;
56
 import com.facebook.react.common.build.ReactBuildConfig;
52
 import com.facebook.react.module.annotations.ReactModule;
57
 import com.facebook.react.module.annotations.ReactModule;
106
 @ReactModule(name = RNCWebViewManager.REACT_CLASS)
111
 @ReactModule(name = RNCWebViewManager.REACT_CLASS)
107
 public class RNCWebViewManager extends SimpleViewManager<WebView> {
112
 public class RNCWebViewManager extends SimpleViewManager<WebView> {
108
 
113
 
109
-  public static String activeUrl = null;
110
   public static final int COMMAND_GO_BACK = 1;
114
   public static final int COMMAND_GO_BACK = 1;
111
   public static final int COMMAND_GO_FORWARD = 2;
115
   public static final int COMMAND_GO_FORWARD = 2;
112
   public static final int COMMAND_RELOAD = 3;
116
   public static final int COMMAND_RELOAD = 3;
194
 
198
 
195
     webView.setDownloadListener(new DownloadListener() {
199
     webView.setDownloadListener(new DownloadListener() {
196
       public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
200
       public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
201
+        webView.setIgnoreErrFailedForThisURL(url);
202
+
197
         RNCWebViewModule module = getModule(reactContext);
203
         RNCWebViewModule module = getModule(reactContext);
198
 
204
 
199
         DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
205
         DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
371
     view.getSettings().setMediaPlaybackRequiresUserGesture(requires);
377
     view.getSettings().setMediaPlaybackRequiresUserGesture(requires);
372
   }
378
   }
373
 
379
 
380
+  @ReactProp(name = "javaScriptCanOpenWindowsAutomatically")
381
+  public void setJavaScriptCanOpenWindowsAutomatically(WebView view, boolean enabled) {
382
+    view.getSettings().setJavaScriptCanOpenWindowsAutomatically(enabled);
383
+  }
384
+
374
   @ReactProp(name = "allowFileAccessFromFileURLs")
385
   @ReactProp(name = "allowFileAccessFromFileURLs")
375
   public void setAllowFileAccessFromFileURLs(WebView view, boolean allow) {
386
   public void setAllowFileAccessFromFileURLs(WebView view, boolean allow) {
376
     view.getSettings().setAllowFileAccessFromFileURLs(allow);
387
     view.getSettings().setAllowFileAccessFromFileURLs(allow);
391
     ((RNCWebView) view).setInjectedJavaScript(injectedJavaScript);
402
     ((RNCWebView) view).setInjectedJavaScript(injectedJavaScript);
392
   }
403
   }
393
 
404
 
405
+  @ReactProp(name = "injectedJavaScriptBeforeContentLoaded")
406
+  public void setInjectedJavaScriptBeforeContentLoaded(WebView view, @Nullable String injectedJavaScriptBeforeContentLoaded) {
407
+    ((RNCWebView) view).setInjectedJavaScriptBeforeContentLoaded(injectedJavaScriptBeforeContentLoaded);
408
+  }
409
+
410
+  @ReactProp(name = "injectedJavaScriptForMainFrameOnly")
411
+  public void setInjectedJavaScriptForMainFrameOnly(WebView view, boolean enabled) {
412
+    ((RNCWebView) view).setInjectedJavaScriptForMainFrameOnly(enabled);
413
+  }
414
+
415
+  @ReactProp(name = "injectedJavaScriptBeforeContentLoadedForMainFrameOnly")
416
+  public void setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(WebView view, boolean enabled) {
417
+    ((RNCWebView) view).setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(enabled);
418
+  }
419
+
394
   @ReactProp(name = "messagingEnabled")
420
   @ReactProp(name = "messagingEnabled")
395
   public void setMessagingEnabled(WebView view, boolean enabled) {
421
   public void setMessagingEnabled(WebView view, boolean enabled) {
396
     ((RNCWebView) view).setMessagingEnabled(enabled);
422
     ((RNCWebView) view).setMessagingEnabled(enabled);
397
   }
423
   }
398
-   
424
+
425
+  @ReactProp(name = "messagingModuleName")
426
+  public void setMessagingModuleName(WebView view, String moduleName) {
427
+    ((RNCWebView) view).setMessagingModuleName(moduleName);
428
+  }
429
+
399
   @ReactProp(name = "incognito")
430
   @ReactProp(name = "incognito")
400
   public void setIncognito(WebView view, boolean enabled) {
431
   public void setIncognito(WebView view, boolean enabled) {
401
     // Remove all previous cookies
432
     // Remove all previous cookies
608
         if (args == null) {
639
         if (args == null) {
609
           throw new RuntimeException("Arguments for loading an url are null!");
640
           throw new RuntimeException("Arguments for loading an url are null!");
610
         }
641
         }
642
+        ((RNCWebView) root).progressChangedFilter.setWaitingForCommandLoadUrl(false);
611
         root.loadUrl(args.getString(0));
643
         root.loadUrl(args.getString(0));
612
         break;
644
         break;
613
       case COMMAND_FOCUS:
645
       case COMMAND_FOCUS:
645
         public Bitmap getDefaultVideoPoster() {
677
         public Bitmap getDefaultVideoPoster() {
646
           return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
678
           return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
647
         }
679
         }
648
-        
680
+
649
         @Override
681
         @Override
650
         public void onShowCustomView(View view, CustomViewCallback callback) {
682
         public void onShowCustomView(View view, CustomViewCallback callback) {
651
           if (mVideoView != null) {
683
           if (mVideoView != null) {
713
     protected boolean mLastLoadFailed = false;
745
     protected boolean mLastLoadFailed = false;
714
     protected @Nullable
746
     protected @Nullable
715
     ReadableArray mUrlPrefixesForDefaultIntent;
747
     ReadableArray mUrlPrefixesForDefaultIntent;
748
+    protected RNCWebView.ProgressChangedFilter progressChangedFilter = null;
749
+    protected @Nullable String ignoreErrFailedForThisURL = null;
750
+
751
+    public void setIgnoreErrFailedForThisURL(@Nullable String url) {
752
+      ignoreErrFailedForThisURL = url;
753
+    }
716
 
754
 
717
     @Override
755
     @Override
718
     public void onPageFinished(WebView webView, String url) {
756
     public void onPageFinished(WebView webView, String url) {
732
       super.onPageStarted(webView, url, favicon);
770
       super.onPageStarted(webView, url, favicon);
733
       mLastLoadFailed = false;
771
       mLastLoadFailed = false;
734
 
772
 
773
+      RNCWebView reactWebView = (RNCWebView) webView;
774
+      reactWebView.callInjectedJavaScriptBeforeContentLoaded();       
775
+
735
       dispatchEvent(
776
       dispatchEvent(
736
         webView,
777
         webView,
737
         new TopLoadingStartEvent(
778
         new TopLoadingStartEvent(
741
 
782
 
742
     @Override
783
     @Override
743
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
784
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
744
-      activeUrl = url;
785
+      progressChangedFilter.setWaitingForCommandLoadUrl(true);
745
       dispatchEvent(
786
       dispatchEvent(
746
         view,
787
         view,
747
         new TopShouldStartLoadWithRequestEvent(
788
         new TopShouldStartLoadWithRequestEvent(
758
       return this.shouldOverrideUrlLoading(view, url);
799
       return this.shouldOverrideUrlLoading(view, url);
759
     }
800
     }
760
 
801
 
802
+    @Override
803
+    public void onReceivedSslError(final WebView webView, final SslErrorHandler handler, final SslError error) {
804
+        handler.cancel();
805
+
806
+        int code = error.getPrimaryError();
807
+        String failingUrl = error.getUrl();
808
+        String description = "";
809
+        String descriptionPrefix = "SSL error: ";
810
+
811
+        // https://developer.android.com/reference/android/net/http/SslError.html
812
+        switch (code) {
813
+          case SslError.SSL_DATE_INVALID:
814
+            description = "The date of the certificate is invalid";
815
+            break;
816
+          case SslError.SSL_EXPIRED:
817
+            description = "The certificate has expired";
818
+            break;
819
+          case SslError.SSL_IDMISMATCH:
820
+            description = "Hostname mismatch";
821
+            break;
822
+          case SslError.SSL_INVALID:
823
+            description = "A generic error occurred";
824
+            break;
825
+          case SslError.SSL_NOTYETVALID:
826
+            description = "The certificate is not yet valid";
827
+            break;
828
+          case SslError.SSL_UNTRUSTED:
829
+            description = "The certificate authority is not trusted";
830
+            break;
831
+          default: 
832
+            description = "Unknown SSL Error";
833
+            break;
834
+        }
835
+        
836
+        description = descriptionPrefix + description;
837
+
838
+        this.onReceivedError(
839
+          webView,
840
+          code,
841
+          description,
842
+          failingUrl
843
+        );
844
+    }
845
+    
761
     @Override
846
     @Override
762
     public void onReceivedError(
847
     public void onReceivedError(
763
       WebView webView,
848
       WebView webView,
764
       int errorCode,
849
       int errorCode,
765
       String description,
850
       String description,
766
       String failingUrl) {
851
       String failingUrl) {
852
+
853
+      if (ignoreErrFailedForThisURL != null
854
+          && failingUrl.equals(ignoreErrFailedForThisURL)
855
+          && errorCode == -1
856
+          && description.equals("net::ERR_FAILED")) {
857
+
858
+        // This is a workaround for a bug in the WebView.
859
+        // See these chromium issues for more context:
860
+        // https://bugs.chromium.org/p/chromium/issues/detail?id=1023678
861
+        // https://bugs.chromium.org/p/chromium/issues/detail?id=1050635
862
+        // This entire commit should be reverted once this bug is resolved in chromium.
863
+        setIgnoreErrFailedForThisURL(null);
864
+        return;
865
+      }
866
+
767
       super.onReceivedError(webView, errorCode, description, failingUrl);
867
       super.onReceivedError(webView, errorCode, description, failingUrl);
768
       mLastLoadFailed = true;
868
       mLastLoadFailed = true;
769
 
869
 
823
     public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {
923
     public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {
824
       mUrlPrefixesForDefaultIntent = specialUrls;
924
       mUrlPrefixesForDefaultIntent = specialUrls;
825
     }
925
     }
926
+
927
+    public void setProgressChangedFilter(RNCWebView.ProgressChangedFilter filter) {
928
+      progressChangedFilter = filter;
929
+    }
826
   }
930
   }
827
 
931
 
828
   protected static class RNCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
932
   protected static class RNCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
844
     protected View mVideoView;
948
     protected View mVideoView;
845
     protected WebChromeClient.CustomViewCallback mCustomViewCallback;
949
     protected WebChromeClient.CustomViewCallback mCustomViewCallback;
846
 
950
 
951
+    protected RNCWebView.ProgressChangedFilter progressChangedFilter = null;
952
+
847
     public RNCWebChromeClient(ReactContext reactContext, WebView webView) {
953
     public RNCWebChromeClient(ReactContext reactContext, WebView webView) {
848
       this.mReactContext = reactContext;
954
       this.mReactContext = reactContext;
849
       this.mWebView = webView;
955
       this.mWebView = webView;
898
     public void onProgressChanged(WebView webView, int newProgress) {
1004
     public void onProgressChanged(WebView webView, int newProgress) {
899
       super.onProgressChanged(webView, newProgress);
1005
       super.onProgressChanged(webView, newProgress);
900
       final String url = webView.getUrl();
1006
       final String url = webView.getUrl();
901
-      if (
902
-        url != null
903
-        && activeUrl != null
904
-        && !url.equals(activeUrl)
905
-      ) {
1007
+      if (progressChangedFilter.isWaitingForCommandLoadUrl()) {
906
         return;
1008
         return;
907
       }
1009
       }
908
       WritableMap event = Arguments.createMap();
1010
       WritableMap event = Arguments.createMap();
941
     public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
1043
     public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
942
       String[] acceptTypes = fileChooserParams.getAcceptTypes();
1044
       String[] acceptTypes = fileChooserParams.getAcceptTypes();
943
       boolean allowMultiple = fileChooserParams.getMode() == WebChromeClient.FileChooserParams.MODE_OPEN_MULTIPLE;
1045
       boolean allowMultiple = fileChooserParams.getMode() == WebChromeClient.FileChooserParams.MODE_OPEN_MULTIPLE;
944
-      Intent intent = fileChooserParams.createIntent();
945
-      return getModule(mReactContext).startPhotoPickerIntent(filePathCallback, intent, acceptTypes, allowMultiple);
1046
+      return getModule(mReactContext).startPhotoPickerIntent(filePathCallback, acceptTypes, allowMultiple);
946
     }
1047
     }
947
 
1048
 
948
     @Override
1049
     @Override
961
     protected ViewGroup getRootView() {
1062
     protected ViewGroup getRootView() {
962
       return (ViewGroup) mReactContext.getCurrentActivity().findViewById(android.R.id.content);
1063
       return (ViewGroup) mReactContext.getCurrentActivity().findViewById(android.R.id.content);
963
     }
1064
     }
1065
+
1066
+    public void setProgressChangedFilter(RNCWebView.ProgressChangedFilter filter) {
1067
+      progressChangedFilter = filter;
1068
+    }
964
   }
1069
   }
965
 
1070
 
966
   /**
1071
   /**
970
   protected static class RNCWebView extends WebView implements LifecycleEventListener {
1075
   protected static class RNCWebView extends WebView implements LifecycleEventListener {
971
     protected @Nullable
1076
     protected @Nullable
972
     String injectedJS;
1077
     String injectedJS;
1078
+    protected @Nullable
1079
+    String injectedJSBeforeContentLoaded;
1080
+
1081
+    /**
1082
+     * android.webkit.WebChromeClient fundamentally does not support JS injection into frames other
1083
+     * than the main frame, so these two properties are mostly here just for parity with iOS & macOS.
1084
+     */
1085
+    protected boolean injectedJavaScriptForMainFrameOnly = true;
1086
+    protected boolean injectedJavaScriptBeforeContentLoadedForMainFrameOnly = true;
1087
+
973
     protected boolean messagingEnabled = false;
1088
     protected boolean messagingEnabled = false;
974
     protected @Nullable
1089
     protected @Nullable
1090
+    String messagingModuleName;
1091
+    protected @Nullable
975
     RNCWebViewClient mRNCWebViewClient;
1092
     RNCWebViewClient mRNCWebViewClient;
1093
+    protected @Nullable
1094
+    CatalystInstance mCatalystInstance;
976
     protected boolean sendContentSizeChangeEvents = false;
1095
     protected boolean sendContentSizeChangeEvents = false;
977
     private OnScrollDispatchHelper mOnScrollDispatchHelper;
1096
     private OnScrollDispatchHelper mOnScrollDispatchHelper;
978
     protected boolean hasScrollEvent = false;
1097
     protected boolean hasScrollEvent = false;
1098
+    protected ProgressChangedFilter progressChangedFilter;
979
 
1099
 
980
     /**
1100
     /**
981
      * WebView must be created with an context of the current activity
1101
      * WebView must be created with an context of the current activity
985
      */
1105
      */
986
     public RNCWebView(ThemedReactContext reactContext) {
1106
     public RNCWebView(ThemedReactContext reactContext) {
987
       super(reactContext);
1107
       super(reactContext);
1108
+      progressChangedFilter = new ProgressChangedFilter();
1109
+    }
1110
+
1111
+    public void setIgnoreErrFailedForThisURL(String url) {
1112
+      mRNCWebViewClient.setIgnoreErrFailedForThisURL(url);
988
     }
1113
     }
989
 
1114
 
990
     public void setSendContentSizeChangeEvents(boolean sendContentSizeChangeEvents) {
1115
     public void setSendContentSizeChangeEvents(boolean sendContentSizeChangeEvents) {
1031
       super.setWebViewClient(client);
1156
       super.setWebViewClient(client);
1032
       if (client instanceof RNCWebViewClient) {
1157
       if (client instanceof RNCWebViewClient) {
1033
         mRNCWebViewClient = (RNCWebViewClient) client;
1158
         mRNCWebViewClient = (RNCWebViewClient) client;
1159
+        mRNCWebViewClient.setProgressChangedFilter(progressChangedFilter);
1160
+      }
1161
+    }
1162
+
1163
+    WebChromeClient mWebChromeClient;
1164
+    @Override
1165
+    public void setWebChromeClient(WebChromeClient client) {
1166
+      this.mWebChromeClient = client;
1167
+      super.setWebChromeClient(client);
1168
+      if (client instanceof RNCWebChromeClient) {
1169
+        ((RNCWebChromeClient) client).setProgressChangedFilter(progressChangedFilter);
1034
       }
1170
       }
1035
     }
1171
     }
1036
 
1172
 
1043
       injectedJS = js;
1179
       injectedJS = js;
1044
     }
1180
     }
1045
 
1181
 
1182
+    public void setInjectedJavaScriptBeforeContentLoaded(@Nullable String js) {
1183
+      injectedJSBeforeContentLoaded = js;
1184
+    }
1185
+
1186
+    public void setInjectedJavaScriptForMainFrameOnly(boolean enabled) {
1187
+      injectedJavaScriptForMainFrameOnly = enabled;
1188
+    }
1189
+
1190
+    public void setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(boolean enabled) {
1191
+      injectedJavaScriptBeforeContentLoadedForMainFrameOnly = enabled;
1192
+    }
1193
+
1046
     protected RNCWebViewBridge createRNCWebViewBridge(RNCWebView webView) {
1194
     protected RNCWebViewBridge createRNCWebViewBridge(RNCWebView webView) {
1047
       return new RNCWebViewBridge(webView);
1195
       return new RNCWebViewBridge(webView);
1048
     }
1196
     }
1049
 
1197
 
1198
+    protected void createCatalystInstance() {
1199
+      ReactContext reactContext = (ReactContext) this.getContext();
1200
+
1201
+      if (reactContext != null) {
1202
+        mCatalystInstance = reactContext.getCatalystInstance();
1203
+      }
1204
+    }
1205
+
1050
     @SuppressLint("AddJavascriptInterface")
1206
     @SuppressLint("AddJavascriptInterface")
1051
     public void setMessagingEnabled(boolean enabled) {
1207
     public void setMessagingEnabled(boolean enabled) {
1052
       if (messagingEnabled == enabled) {
1208
       if (messagingEnabled == enabled) {
1057
 
1213
 
1058
       if (enabled) {
1214
       if (enabled) {
1059
         addJavascriptInterface(createRNCWebViewBridge(this), JAVASCRIPT_INTERFACE);
1215
         addJavascriptInterface(createRNCWebViewBridge(this), JAVASCRIPT_INTERFACE);
1216
+        this.createCatalystInstance();
1060
       } else {
1217
       } else {
1061
         removeJavascriptInterface(JAVASCRIPT_INTERFACE);
1218
         removeJavascriptInterface(JAVASCRIPT_INTERFACE);
1062
       }
1219
       }
1063
     }
1220
     }
1064
 
1221
 
1222
+    public void setMessagingModuleName(String moduleName) {
1223
+      messagingModuleName = moduleName;
1224
+    }
1225
+
1065
     protected void evaluateJavascriptWithFallback(String script) {
1226
     protected void evaluateJavascriptWithFallback(String script) {
1066
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
1227
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
1067
         evaluateJavascript(script, null);
1228
         evaluateJavascript(script, null);
1084
       }
1245
       }
1085
     }
1246
     }
1086
 
1247
 
1248
+    public void callInjectedJavaScriptBeforeContentLoaded() {
1249
+      if (getSettings().getJavaScriptEnabled() &&
1250
+      injectedJSBeforeContentLoaded != null &&
1251
+      !TextUtils.isEmpty(injectedJSBeforeContentLoaded)) {
1252
+        evaluateJavascriptWithFallback("(function() {\n" + injectedJSBeforeContentLoaded + ";\n})();");
1253
+      }
1254
+    }
1255
+
1087
     public void onMessage(String message) {
1256
     public void onMessage(String message) {
1257
+      ReactContext reactContext = (ReactContext) this.getContext();
1258
+      RNCWebView mContext = this;
1259
+
1088
       if (mRNCWebViewClient != null) {
1260
       if (mRNCWebViewClient != null) {
1089
         WebView webView = this;
1261
         WebView webView = this;
1090
         webView.post(new Runnable() {
1262
         webView.post(new Runnable() {
1095
             }
1267
             }
1096
             WritableMap data = mRNCWebViewClient.createWebViewEvent(webView, webView.getUrl());
1268
             WritableMap data = mRNCWebViewClient.createWebViewEvent(webView, webView.getUrl());
1097
             data.putString("data", message);
1269
             data.putString("data", message);
1098
-            dispatchEvent(webView, new TopMessageEvent(webView.getId(), data));
1270
+
1271
+            if (mCatalystInstance != null) {
1272
+              mContext.sendDirectMessage(data);
1273
+            } else {
1274
+              dispatchEvent(webView, new TopMessageEvent(webView.getId(), data));
1275
+            }
1099
           }
1276
           }
1100
         });
1277
         });
1101
       } else {
1278
       } else {
1102
         WritableMap eventData = Arguments.createMap();
1279
         WritableMap eventData = Arguments.createMap();
1103
         eventData.putString("data", message);
1280
         eventData.putString("data", message);
1104
-        dispatchEvent(this, new TopMessageEvent(this.getId(), eventData));
1281
+
1282
+        if (mCatalystInstance != null) {
1283
+          this.sendDirectMessage(eventData);
1284
+        } else {
1285
+          dispatchEvent(this, new TopMessageEvent(this.getId(), eventData));
1286
+        }
1105
       }
1287
       }
1106
     }
1288
     }
1107
 
1289
 
1290
+    protected void sendDirectMessage(WritableMap data) {
1291
+      WritableNativeMap event = new WritableNativeMap();
1292
+      event.putMap("nativeEvent", data);
1293
+
1294
+      WritableNativeArray params = new WritableNativeArray();
1295
+      params.pushMap(event);
1296
+
1297
+      mCatalystInstance.callFunction(messagingModuleName, "onMessage", params);
1298
+    }
1299
+
1108
     protected void onScrollChanged(int x, int y, int oldX, int oldY) {
1300
     protected void onScrollChanged(int x, int y, int oldX, int oldY) {
1109
       super.onScrollChanged(x, y, oldX, oldY);
1301
       super.onScrollChanged(x, y, oldX, oldY);
1110
 
1302
 
1138
       destroy();
1330
       destroy();
1139
     }
1331
     }
1140
 
1332
 
1333
+    @Override
1334
+    public void destroy() {
1335
+      if (mWebChromeClient != null) {
1336
+        mWebChromeClient.onHideCustomView();
1337
+      }
1338
+      super.destroy();
1339
+    }
1340
+
1141
     protected class RNCWebViewBridge {
1341
     protected class RNCWebViewBridge {
1142
       RNCWebView mContext;
1342
       RNCWebView mContext;
1143
 
1343
 
1154
         mContext.onMessage(message);
1354
         mContext.onMessage(message);
1155
       }
1355
       }
1156
     }
1356
     }
1357
+
1358
+    protected static class ProgressChangedFilter {
1359
+      private boolean waitingForCommandLoadUrl = false;
1360
+
1361
+      public void setWaitingForCommandLoadUrl(boolean isWaiting) {
1362
+        waitingForCommandLoadUrl = isWaiting;
1363
+      }
1364
+
1365
+      public boolean isWaitingForCommandLoadUrl() {
1366
+        return waitingForCommandLoadUrl;
1367
+      }
1368
+    }
1157
   }
1369
   }
1158
 }
1370
 }

+ 152
- 71
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java Просмотреть файл

11
 import android.os.Environment;
11
 import android.os.Environment;
12
 import android.os.Parcelable;
12
 import android.os.Parcelable;
13
 import android.provider.MediaStore;
13
 import android.provider.MediaStore;
14
+
14
 import androidx.annotation.RequiresApi;
15
 import androidx.annotation.RequiresApi;
15
 import androidx.core.content.ContextCompat;
16
 import androidx.core.content.ContextCompat;
16
 import androidx.core.content.FileProvider;
17
 import androidx.core.content.FileProvider;
18
+
17
 import android.util.Log;
19
 import android.util.Log;
18
 import android.webkit.MimeTypeMap;
20
 import android.webkit.MimeTypeMap;
19
 import android.webkit.ValueCallback;
21
 import android.webkit.ValueCallback;
42
   private static final int PICKER = 1;
44
   private static final int PICKER = 1;
43
   private static final int PICKER_LEGACY = 3;
45
   private static final int PICKER_LEGACY = 3;
44
   private static final int FILE_DOWNLOAD_PERMISSION_REQUEST = 1;
46
   private static final int FILE_DOWNLOAD_PERMISSION_REQUEST = 1;
45
-  final String DEFAULT_MIME_TYPES = "*/*";
46
   private ValueCallback<Uri> filePathCallbackLegacy;
47
   private ValueCallback<Uri> filePathCallbackLegacy;
47
   private ValueCallback<Uri[]> filePathCallback;
48
   private ValueCallback<Uri[]> filePathCallback;
48
-  private Uri outputFileUri;
49
+  private File outputImage;
50
+  private File outputVideo;
49
   private DownloadManager.Request downloadRequest;
51
   private DownloadManager.Request downloadRequest;
52
+
53
+  private enum MimeType {
54
+    DEFAULT("*/*"),
55
+    IMAGE("image"),
56
+    VIDEO("video");
57
+
58
+    private final String value;
59
+
60
+    MimeType(String value) {
61
+      this.value = value;
62
+    }
63
+  }
64
+
50
   private PermissionListener webviewFileDownloaderPermissionListener = new PermissionListener() {
65
   private PermissionListener webviewFileDownloaderPermissionListener = new PermissionListener() {
51
     @Override
66
     @Override
52
     public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
67
     public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
96
       return;
111
       return;
97
     }
112
     }
98
 
113
 
114
+    boolean imageTaken = false;
115
+    boolean videoTaken = false;
116
+
117
+    if (outputImage != null && outputImage.length() > 0) {
118
+      imageTaken = true;
119
+    }
120
+    if (outputVideo != null && outputVideo.length() > 0) {
121
+      videoTaken = true;
122
+    }
123
+
99
     // based off of which button was pressed, we get an activity result and a file
124
     // based off of which button was pressed, we get an activity result and a file
100
     // the camera activity doesn't properly return the filename* (I think?) so we use
125
     // the camera activity doesn't properly return the filename* (I think?) so we use
101
     // this filename instead
126
     // this filename instead
106
             filePathCallback.onReceiveValue(null);
131
             filePathCallback.onReceiveValue(null);
107
           }
132
           }
108
         } else {
133
         } else {
109
-          Uri result[] = this.getSelectedFiles(data, resultCode);
110
-          if (result != null) {
111
-            filePathCallback.onReceiveValue(result);
134
+          if (imageTaken) {
135
+            filePathCallback.onReceiveValue(new Uri[]{getOutputUri(outputImage)});
136
+          } else if (videoTaken) {
137
+            filePathCallback.onReceiveValue(new Uri[]{getOutputUri(outputVideo)});
112
           } else {
138
           } else {
113
-            filePathCallback.onReceiveValue(new Uri[]{outputFileUri});
139
+            filePathCallback.onReceiveValue(this.getSelectedFiles(data, resultCode));
114
           }
140
           }
115
         }
141
         }
116
         break;
142
         break;
117
       case PICKER_LEGACY:
143
       case PICKER_LEGACY:
118
-        Uri result = resultCode != Activity.RESULT_OK ? null : data == null ? outputFileUri : data.getData();
119
-        filePathCallbackLegacy.onReceiveValue(result);
144
+        if (resultCode != RESULT_OK) {
145
+          filePathCallbackLegacy.onReceiveValue(null);
146
+        } else {
147
+          if (imageTaken) {
148
+            filePathCallbackLegacy.onReceiveValue(getOutputUri(outputImage));
149
+          } else if (videoTaken) {
150
+            filePathCallbackLegacy.onReceiveValue(getOutputUri(outputVideo));
151
+          } else {
152
+            filePathCallbackLegacy.onReceiveValue(data.getData());
153
+          }
154
+        }
120
         break;
155
         break;
121
 
156
 
122
     }
157
     }
158
+
159
+    if (outputImage != null && !imageTaken) {
160
+      outputImage.delete();
161
+    }
162
+    if (outputVideo != null && !videoTaken) {
163
+      outputVideo.delete();
164
+    }
165
+
123
     filePathCallback = null;
166
     filePathCallback = null;
124
     filePathCallbackLegacy = null;
167
     filePathCallbackLegacy = null;
125
-    outputFileUri = null;
168
+    outputImage = null;
169
+    outputVideo = null;
126
   }
170
   }
127
 
171
 
128
   public void onNewIntent(Intent intent) {
172
   public void onNewIntent(Intent intent) {
133
       return null;
177
       return null;
134
     }
178
     }
135
 
179
 
136
-    // we have one file selected
137
-    if (data.getData() != null) {
138
-      if (resultCode == RESULT_OK && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
139
-        return WebChromeClient.FileChooserParams.parseResult(resultCode, data);
140
-      } else {
141
-        return null;
142
-      }
143
-    }
144
-
145
     // we have multiple files selected
180
     // we have multiple files selected
146
     if (data.getClipData() != null) {
181
     if (data.getClipData() != null) {
147
       final int numSelectedFiles = data.getClipData().getItemCount();
182
       final int numSelectedFiles = data.getClipData().getItemCount();
151
       }
186
       }
152
       return result;
187
       return result;
153
     }
188
     }
189
+
190
+    // we have one file selected
191
+    if (data.getData() != null && resultCode == RESULT_OK && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
192
+      return WebChromeClient.FileChooserParams.parseResult(resultCode, data);
193
+    }
194
+
154
     return null;
195
     return null;
155
   }
196
   }
156
 
197
 
162
 
203
 
163
     ArrayList<Parcelable> extraIntents = new ArrayList<>();
204
     ArrayList<Parcelable> extraIntents = new ArrayList<>();
164
     if (acceptsImages(acceptType)) {
205
     if (acceptsImages(acceptType)) {
165
-      extraIntents.add(getPhotoIntent());
206
+      Intent photoIntent = getPhotoIntent();
207
+      if (photoIntent != null) {
208
+        extraIntents.add(photoIntent);
209
+      }
166
     }
210
     }
167
     if (acceptsVideo(acceptType)) {
211
     if (acceptsVideo(acceptType)) {
168
-      extraIntents.add(getVideoIntent());
212
+      Intent videoIntent = getVideoIntent();
213
+      if (videoIntent != null) {
214
+        extraIntents.add(videoIntent);
215
+      }
169
     }
216
     }
170
     chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents.toArray(new Parcelable[]{}));
217
     chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents.toArray(new Parcelable[]{}));
171
 
218
 
177
   }
224
   }
178
 
225
 
179
   @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
226
   @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
180
-  public boolean startPhotoPickerIntent(final ValueCallback<Uri[]> callback, final Intent intent, final String[] acceptTypes, final boolean allowMultiple) {
227
+  public boolean startPhotoPickerIntent(final ValueCallback<Uri[]> callback, final String[] acceptTypes, final boolean allowMultiple) {
181
     filePathCallback = callback;
228
     filePathCallback = callback;
182
 
229
 
183
     ArrayList<Parcelable> extraIntents = new ArrayList<>();
230
     ArrayList<Parcelable> extraIntents = new ArrayList<>();
184
-    if (! needsCameraPermission()) {
231
+    if (!needsCameraPermission()) {
185
       if (acceptsImages(acceptTypes)) {
232
       if (acceptsImages(acceptTypes)) {
186
-        extraIntents.add(getPhotoIntent());
233
+        Intent photoIntent = getPhotoIntent();
234
+        if (photoIntent != null) {
235
+          extraIntents.add(photoIntent);
236
+        }
187
       }
237
       }
188
       if (acceptsVideo(acceptTypes)) {
238
       if (acceptsVideo(acceptTypes)) {
189
-        extraIntents.add(getVideoIntent());
239
+        Intent videoIntent = getVideoIntent();
240
+        if (videoIntent != null) {
241
+          extraIntents.add(videoIntent);
242
+        }
190
       }
243
       }
191
     }
244
     }
192
 
245
 
219
   }
272
   }
220
 
273
 
221
   public boolean grantFileDownloaderPermissions() {
274
   public boolean grantFileDownloaderPermissions() {
222
-    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
275
+    // Permission not required for Android Q and above
276
+    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
223
       return true;
277
       return true;
224
     }
278
     }
225
 
279
 
226
-    boolean result = true;
227
-    if (ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
228
-      result = false;
229
-    }
230
-
231
-    if (!result) {
280
+    boolean result = ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
281
+    if (!result && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
232
       PermissionAwareActivity activity = getPermissionAwareActivity();
282
       PermissionAwareActivity activity = getPermissionAwareActivity();
233
       activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, FILE_DOWNLOAD_PERMISSION_REQUEST, webviewFileDownloaderPermissionListener);
283
       activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, FILE_DOWNLOAD_PERMISSION_REQUEST, webviewFileDownloaderPermissionListener);
234
     }
284
     }
254
   }
304
   }
255
 
305
 
256
   private Intent getPhotoIntent() {
306
   private Intent getPhotoIntent() {
257
-    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
258
-    outputFileUri = getOutputUri(MediaStore.ACTION_IMAGE_CAPTURE);
259
-    intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
307
+    Intent intent = null;
308
+
309
+    try {
310
+      outputImage = getCapturedFile(MimeType.IMAGE);
311
+      Uri outputImageUri = getOutputUri(outputImage);
312
+      intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
313
+      intent.putExtra(MediaStore.EXTRA_OUTPUT, outputImageUri);
314
+    } catch (IOException | IllegalArgumentException e) {
315
+      Log.e("CREATE FILE", "Error occurred while creating the File", e);
316
+      e.printStackTrace();
317
+    }
318
+
260
     return intent;
319
     return intent;
261
   }
320
   }
262
 
321
 
263
   private Intent getVideoIntent() {
322
   private Intent getVideoIntent() {
264
-    Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
265
-    outputFileUri = getOutputUri(MediaStore.ACTION_VIDEO_CAPTURE);
266
-    intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
323
+    Intent intent = null;
324
+
325
+    try {
326
+      outputVideo = getCapturedFile(MimeType.VIDEO);
327
+      Uri outputVideoUri = getOutputUri(outputVideo);
328
+      intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
329
+      intent.putExtra(MediaStore.EXTRA_OUTPUT, outputVideoUri);
330
+    } catch (IOException | IllegalArgumentException e) {
331
+      Log.e("CREATE FILE", "Error occurred while creating the File", e);
332
+      e.printStackTrace();
333
+    }
334
+    
267
     return intent;
335
     return intent;
268
   }
336
   }
269
 
337
 
270
   private Intent getFileChooserIntent(String acceptTypes) {
338
   private Intent getFileChooserIntent(String acceptTypes) {
271
     String _acceptTypes = acceptTypes;
339
     String _acceptTypes = acceptTypes;
272
     if (acceptTypes.isEmpty()) {
340
     if (acceptTypes.isEmpty()) {
273
-      _acceptTypes = DEFAULT_MIME_TYPES;
341
+      _acceptTypes = MimeType.DEFAULT.value;
274
     }
342
     }
275
     if (acceptTypes.matches("\\.\\w+")) {
343
     if (acceptTypes.matches("\\.\\w+")) {
276
       _acceptTypes = getMimeTypeFromExtension(acceptTypes.replace(".", ""));
344
       _acceptTypes = getMimeTypeFromExtension(acceptTypes.replace(".", ""));
284
   private Intent getFileChooserIntent(String[] acceptTypes, boolean allowMultiple) {
352
   private Intent getFileChooserIntent(String[] acceptTypes, boolean allowMultiple) {
285
     Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
353
     Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
286
     intent.addCategory(Intent.CATEGORY_OPENABLE);
354
     intent.addCategory(Intent.CATEGORY_OPENABLE);
287
-    intent.setType("*/*");
355
+    intent.setType(MimeType.DEFAULT.value);
288
     intent.putExtra(Intent.EXTRA_MIME_TYPES, getAcceptedMimeType(acceptTypes));
356
     intent.putExtra(Intent.EXTRA_MIME_TYPES, getAcceptedMimeType(acceptTypes));
289
     intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
357
     intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultiple);
290
     return intent;
358
     return intent;
295
     if (types.matches("\\.\\w+")) {
363
     if (types.matches("\\.\\w+")) {
296
       mimeType = getMimeTypeFromExtension(types.replace(".", ""));
364
       mimeType = getMimeTypeFromExtension(types.replace(".", ""));
297
     }
365
     }
298
-    return mimeType.isEmpty() || mimeType.toLowerCase().contains("image");
366
+    return mimeType.isEmpty() || mimeType.toLowerCase().contains(MimeType.IMAGE.value);
299
   }
367
   }
300
 
368
 
301
   private Boolean acceptsImages(String[] types) {
369
   private Boolean acceptsImages(String[] types) {
302
     String[] mimeTypes = getAcceptedMimeType(types);
370
     String[] mimeTypes = getAcceptedMimeType(types);
303
-    return isArrayEmpty(mimeTypes) || arrayContainsString(mimeTypes, "image");
371
+    return arrayContainsString(mimeTypes, MimeType.DEFAULT.value) || arrayContainsString(mimeTypes, MimeType.IMAGE.value);
304
   }
372
   }
305
 
373
 
306
   private Boolean acceptsVideo(String types) {
374
   private Boolean acceptsVideo(String types) {
375
+    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
376
+      return false;
377
+    }
378
+
307
     String mimeType = types;
379
     String mimeType = types;
308
     if (types.matches("\\.\\w+")) {
380
     if (types.matches("\\.\\w+")) {
309
       mimeType = getMimeTypeFromExtension(types.replace(".", ""));
381
       mimeType = getMimeTypeFromExtension(types.replace(".", ""));
310
     }
382
     }
311
-    return mimeType.isEmpty() || mimeType.toLowerCase().contains("video");
383
+    return mimeType.isEmpty() || mimeType.toLowerCase().contains(MimeType.VIDEO.value);
312
   }
384
   }
313
 
385
 
314
   private Boolean acceptsVideo(String[] types) {
386
   private Boolean acceptsVideo(String[] types) {
387
+    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
388
+      return false;
389
+    }
390
+
315
     String[] mimeTypes = getAcceptedMimeType(types);
391
     String[] mimeTypes = getAcceptedMimeType(types);
316
-    return isArrayEmpty(mimeTypes) || arrayContainsString(mimeTypes, "video");
392
+    return arrayContainsString(mimeTypes, MimeType.DEFAULT.value) || arrayContainsString(mimeTypes, MimeType.VIDEO.value);
317
   }
393
   }
318
 
394
 
319
   private Boolean arrayContainsString(String[] array, String pattern) {
395
   private Boolean arrayContainsString(String[] array, String pattern) {
326
   }
402
   }
327
 
403
 
328
   private String[] getAcceptedMimeType(String[] types) {
404
   private String[] getAcceptedMimeType(String[] types) {
329
-    if (isArrayEmpty(types)) {
330
-      return new String[]{DEFAULT_MIME_TYPES};
405
+    if (noAcceptTypesSet(types)) {
406
+      return new String[]{MimeType.DEFAULT.value};
331
     }
407
     }
332
     String[] mimeTypes = new String[types.length];
408
     String[] mimeTypes = new String[types.length];
333
     for (int i = 0; i < types.length; i++) {
409
     for (int i = 0; i < types.length; i++) {
335
       // convert file extensions to mime types
411
       // convert file extensions to mime types
336
       if (t.matches("\\.\\w+")) {
412
       if (t.matches("\\.\\w+")) {
337
         String mimeType = getMimeTypeFromExtension(t.replace(".", ""));
413
         String mimeType = getMimeTypeFromExtension(t.replace(".", ""));
338
-        mimeTypes[i] = mimeType;
414
+        if(mimeType != null) {
415
+          mimeTypes[i] = mimeType;
416
+        } else {
417
+          mimeTypes[i] = t;
418
+        }
339
       } else {
419
       } else {
340
         mimeTypes[i] = t;
420
         mimeTypes[i] = t;
341
       }
421
       }
351
     return type;
431
     return type;
352
   }
432
   }
353
 
433
 
354
-  private Uri getOutputUri(String intentType) {
355
-    File capturedFile = null;
356
-    try {
357
-      capturedFile = getCapturedFile(intentType);
358
-    } catch (IOException e) {
359
-      Log.e("CREATE FILE", "Error occurred while creating the File", e);
360
-      e.printStackTrace();
361
-    }
362
-
434
+  private Uri getOutputUri(File capturedFile) {
363
     // for versions below 6.0 (23) we use the old File creation & permissions model
435
     // for versions below 6.0 (23) we use the old File creation & permissions model
364
     if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
436
     if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
365
       return Uri.fromFile(capturedFile);
437
       return Uri.fromFile(capturedFile);
370
     return FileProvider.getUriForFile(getReactApplicationContext(), packageName + ".fileprovider", capturedFile);
442
     return FileProvider.getUriForFile(getReactApplicationContext(), packageName + ".fileprovider", capturedFile);
371
   }
443
   }
372
 
444
 
373
-  private File getCapturedFile(String intentType) throws IOException {
445
+  private File getCapturedFile(MimeType mimeType) throws IOException {
374
     String prefix = "";
446
     String prefix = "";
375
     String suffix = "";
447
     String suffix = "";
376
     String dir = "";
448
     String dir = "";
377
-    String filename = "";
378
 
449
 
379
-    if (intentType.equals(MediaStore.ACTION_IMAGE_CAPTURE)) {
380
-      prefix = "image-";
381
-      suffix = ".jpg";
382
-      dir = Environment.DIRECTORY_PICTURES;
383
-    } else if (intentType.equals(MediaStore.ACTION_VIDEO_CAPTURE)) {
384
-      prefix = "video-";
385
-      suffix = ".mp4";
386
-      dir = Environment.DIRECTORY_MOVIES;
450
+    switch (mimeType) {
451
+      case IMAGE:
452
+        prefix = "image-";
453
+        suffix = ".jpg";
454
+        dir = Environment.DIRECTORY_PICTURES;
455
+        break;
456
+      case VIDEO:
457
+        prefix = "video-";
458
+        suffix = ".mp4";
459
+        dir = Environment.DIRECTORY_MOVIES;
460
+        break;
461
+
462
+      default:
463
+        break;
387
     }
464
     }
388
 
465
 
389
-    filename = prefix + String.valueOf(System.currentTimeMillis()) + suffix;
466
+    String filename = prefix + String.valueOf(System.currentTimeMillis()) + suffix;
467
+    File outputFile = null;
390
 
468
 
391
     // for versions below 6.0 (23) we use the old File creation & permissions model
469
     // for versions below 6.0 (23) we use the old File creation & permissions model
392
     if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
470
     if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
393
       // only this Directory works on all tested Android versions
471
       // only this Directory works on all tested Android versions
394
       // ctx.getExternalFilesDir(dir) was failing on Android 5.0 (sdk 21)
472
       // ctx.getExternalFilesDir(dir) was failing on Android 5.0 (sdk 21)
395
       File storageDir = Environment.getExternalStoragePublicDirectory(dir);
473
       File storageDir = Environment.getExternalStoragePublicDirectory(dir);
396
-      return new File(storageDir, filename);
474
+      outputFile = new File(storageDir, filename);
475
+    } else {
476
+      File storageDir = getReactApplicationContext().getExternalFilesDir(null);
477
+      outputFile = File.createTempFile(prefix, suffix, storageDir);
397
     }
478
     }
398
 
479
 
399
-    File storageDir = getReactApplicationContext().getExternalFilesDir(null);
400
-    return File.createTempFile(filename, suffix, storageDir);
480
+    return outputFile;
401
   }
481
   }
402
 
482
 
403
-  private Boolean isArrayEmpty(String[] arr) {
483
+  private Boolean noAcceptTypesSet(String[] types) {
404
     // when our array returned from getAcceptTypes() has no values set from the webview
484
     // when our array returned from getAcceptTypes() has no values set from the webview
405
     // i.e. <input type="file" />, without any "accept" attr
485
     // i.e. <input type="file" />, without any "accept" attr
406
     // will be an array with one empty string element, afaik
486
     // will be an array with one empty string element, afaik
407
-    return arr.length == 0 || (arr.length == 1 && arr[0].length() == 0);
487
+
488
+    return types.length == 0 || (types.length == 1 && types[0] != null && types[0].length() == 0);
408
   }
489
   }
409
 
490
 
410
   private PermissionAwareActivity getPermissionAwareActivity() {
491
   private PermissionAwareActivity getPermissionAwareActivity() {

ios/RNCWKProcessPoolManager.h → apple/RNCWKProcessPoolManager.h Просмотреть файл


ios/RNCWKProcessPoolManager.m → apple/RNCWKProcessPoolManager.m Просмотреть файл


ios/RNCWebView.h → apple/RNCWebView.h Просмотреть файл

54
 @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
54
 @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
55
 @property (nonatomic, assign) BOOL cacheEnabled;
55
 @property (nonatomic, assign) BOOL cacheEnabled;
56
 @property (nonatomic, assign) BOOL javaScriptEnabled;
56
 @property (nonatomic, assign) BOOL javaScriptEnabled;
57
+@property (nonatomic, assign) BOOL javaScriptCanOpenWindowsAutomatically;
57
 @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
58
 @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
58
 @property (nonatomic, assign) BOOL allowsLinkPreview;
59
 @property (nonatomic, assign) BOOL allowsLinkPreview;
59
 @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
60
 @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
60
 @property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
61
 @property (nonatomic, assign) BOOL showsVerticalScrollIndicator;
61
 @property (nonatomic, assign) BOOL directionalLockEnabled;
62
 @property (nonatomic, assign) BOOL directionalLockEnabled;
63
+@property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
62
 @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
64
 @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
63
 
65
 
64
 + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
66
 + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;

ios/RNCWebView.m → apple/RNCWebView.m Просмотреть файл

67
     UIScrollViewDelegate,
67
     UIScrollViewDelegate,
68
 #endif // !TARGET_OS_OSX
68
 #endif // !TARGET_OS_OSX
69
     RCTAutoInsetsProtocol>
69
     RCTAutoInsetsProtocol>
70
+
71
+@property (nonatomic, copy) RCTDirectEventBlock onFileDownload;
70
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
72
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
71
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
73
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingFinish;
72
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingError;
74
 @property (nonatomic, copy) RCTDirectEventBlock onLoadingError;
140
   }
142
   }
141
 
143
 
142
 #if !TARGET_OS_OSX
144
 #if !TARGET_OS_OSX
145
+    [[NSNotificationCenter defaultCenter]addObserver:self
146
+    selector:@selector(appDidBecomeActive)
147
+        name:UIApplicationDidBecomeActiveNotification
148
+      object:nil];
149
+
150
+    [[NSNotificationCenter defaultCenter]addObserver:self
151
+    selector:@selector(appWillResignActive)
152
+        name:UIApplicationWillResignActiveNotification
153
+      object:nil];
143
   if (@available(iOS 12.0, *)) {
154
   if (@available(iOS 12.0, *)) {
144
     // Workaround for a keyboard dismissal bug present in iOS 12
155
     // Workaround for a keyboard dismissal bug present in iOS 12
145
     // https://openradar.appspot.com/radar?id=5018321736957952
156
     // https://openradar.appspot.com/radar?id=5018321736957952
163
                                                selector:@selector(hideFullScreenVideoStatusBars)
174
                                                selector:@selector(hideFullScreenVideoStatusBars)
164
                                                    name:UIWindowDidBecomeHiddenNotification
175
                                                    name:UIWindowDidBecomeHiddenNotification
165
                                                  object:nil];
176
                                                  object:nil];
177
+
166
   }
178
   }
167
 #endif // !TARGET_OS_OSX
179
 #endif // !TARGET_OS_OSX
168
   return self;
180
   return self;
197
     [prefs setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
209
     [prefs setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
198
     _prefsUsed = YES;
210
     _prefsUsed = YES;
199
   }
211
   }
212
+  if (_javaScriptCanOpenWindowsAutomatically) {
213
+    [prefs setValue:@TRUE forKey:@"javaScriptCanOpenWindowsAutomatically"];
214
+    _prefsUsed = YES;
215
+  }
200
   if (_prefsUsed) {
216
   if (_prefsUsed) {
201
     wkWebViewConfig.preferences = prefs;
217
     wkWebViewConfig.preferences = prefs;
202
   }
218
   }
230
   if (_applicationNameForUserAgent) {
246
   if (_applicationNameForUserAgent) {
231
       wkWebViewConfig.applicationNameForUserAgent = [NSString stringWithFormat:@"%@ %@", wkWebViewConfig.applicationNameForUserAgent, _applicationNameForUserAgent];
247
       wkWebViewConfig.applicationNameForUserAgent = [NSString stringWithFormat:@"%@ %@", wkWebViewConfig.applicationNameForUserAgent, _applicationNameForUserAgent];
232
   }
248
   }
233
-  
249
+
234
   return wkWebViewConfig;
250
   return wkWebViewConfig;
235
 }
251
 }
236
 
252
 
295
         _webView.scrollView.delegate = nil;
311
         _webView.scrollView.delegate = nil;
296
 #endif // !TARGET_OS_OSX
312
 #endif // !TARGET_OS_OSX
297
         _webView = nil;
313
         _webView = nil;
314
+        if (_onContentProcessDidTerminate) {
315
+          NSMutableDictionary<NSString *, id> *event = [self baseEvent];
316
+          _onContentProcessDidTerminate(event);
317
+        }
298
     }
318
     }
299
 
319
 
300
     [super removeFromSuperview];
320
     [super removeFromSuperview];
963
   decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse
983
   decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse
964
                     decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
984
                     decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler
965
 {
985
 {
986
+  WKNavigationResponsePolicy policy = WKNavigationResponsePolicyAllow;
966
   if (_onHttpError && navigationResponse.forMainFrame) {
987
   if (_onHttpError && navigationResponse.forMainFrame) {
967
     if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]]) {
988
     if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]]) {
968
       NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response;
989
       NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response;
969
       NSInteger statusCode = response.statusCode;
990
       NSInteger statusCode = response.statusCode;
970
 
991
 
971
       if (statusCode >= 400) {
992
       if (statusCode >= 400) {
972
-        NSMutableDictionary<NSString *, id> *event = [self baseEvent];
973
-        [event addEntriesFromDictionary: @{
993
+        NSMutableDictionary<NSString *, id> *httpErrorEvent = [self baseEvent];
994
+        [httpErrorEvent addEntriesFromDictionary: @{
974
           @"url": response.URL.absoluteString,
995
           @"url": response.URL.absoluteString,
975
           @"statusCode": @(statusCode)
996
           @"statusCode": @(statusCode)
976
         }];
997
         }];
977
 
998
 
978
-        _onHttpError(event);
999
+        _onHttpError(httpErrorEvent);
1000
+      }
1001
+
1002
+      NSString *disposition = nil;
1003
+      if (@available(iOS 13, *)) {
1004
+        disposition = [response valueForHTTPHeaderField:@"Content-Disposition"];
1005
+      }
1006
+      BOOL isAttachment = disposition != nil && [disposition hasPrefix:@"attachment"];
1007
+      if (isAttachment || !navigationResponse.canShowMIMEType) {
1008
+        if (_onFileDownload) {
1009
+          policy = WKNavigationResponsePolicyCancel;
1010
+
1011
+          NSMutableDictionary<NSString *, id> *downloadEvent = [self baseEvent];
1012
+          [downloadEvent addEntriesFromDictionary: @{
1013
+            @"downloadUrl": (response.URL).absoluteString,
1014
+          }];
1015
+          _onFileDownload(downloadEvent);
1016
+        }
979
       }
1017
       }
980
     }
1018
     }
981
-  }  
1019
+  }
982
 
1020
 
983
-  decisionHandler(WKNavigationResponsePolicyAllow);
1021
+  decisionHandler(policy);
984
 }
1022
 }
985
 
1023
 
986
 /**
1024
 /**
1031
   }];
1069
   }];
1032
 }
1070
 }
1033
 
1071
 
1072
+-(void)forceIgnoreSilentHardwareSwitch:(BOOL)initialSetup
1073
+{
1074
+    NSString *mp3Str = @"data:audio/mp3;base64,//tAxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAFAAAESAAzMzMzMzMzMzMzMzMzMzMzMzMzZmZmZmZmZmZmZmZmZmZmZmZmZmaZmZmZmZmZmZmZmZmZmZmZmZmZmczMzMzMzMzMzMzMzMzMzMzMzMzM//////////////////////////8AAAA5TEFNRTMuMTAwAZYAAAAAAAAAABQ4JAMGQgAAOAAABEhNIZS0AAAAAAD/+0DEAAPH3Yz0AAR8CPqyIEABp6AxjG/4x/XiInE4lfQDFwIIRE+uBgZoW4RL0OLMDFn6E5v+/u5ehf76bu7/6bu5+gAiIQGAABQIUJ0QolFghEn/9PhZQpcUTpXMjo0OGzRCZXyKxoIQzB2KhCtGobpT9TRVj/3Pmfp+f8X7Pu1B04sTnc3s0XhOlXoGVCMNo9X//9/r6a10TZEY5DsxqvO7mO5qFvpFCmKIjhpSItGsUYcRO//7QsQRgEiljQIAgLFJAbIhNBCa+JmorCbOi5q9nVd2dKnusTMQg4MFUlD6DQ4OFijwGAijRMfLbHG4nLVTjydyPlJTj8pfPflf9/5GD950A5e+jsrmNZSjSirjs1R7hnkia8vr//l/7Nb+crvr9Ok5ZJOylUKRxf/P9Zn0j2P4pJYXyKkeuy5wUYtdmOu6uobEtFqhIJViLEKIjGxchGev/L3Y0O3bwrIOszTBAZ7Ih28EUaSOZf/7QsQfg8fpjQIADN0JHbGgQBAZ8T//y//t/7d/2+f5m7MdCeo/9tdkMtGLbt1tqnabRroO1Qfvh20yEbei8nfDXP7btW7f9/uO9tbe5IvHQbLlxpf3DkAk0ojYcv///5/u3/7PTfGjPEPUvt5D6f+/3Lea4lz4tc4TnM/mFPrmalWbboeNiNyeyr+vufttZuvrVrt/WYv3T74JFo8qEDiJqJrmDTs///v99xDku2xG02jjunrICP/7QsQtA8kpkQAAgNMA/7FgQAGnobgfghgqA+uXwWQ3XFmGimSbe2X3ksY//KzK1a2k6cnNWOPJnPWUsYbKqkh8RJzrVf///P///////4vyhLKHLrCb5nIrYIUss4cthigL1lQ1wwNAc6C1pf1TIKRSkt+a//z+yLVcwlXKSqeSuCVQFLng2h4AFAFgTkH+Z/8jTX/zr//zsJV/5f//5UX/0ZNCNCCaf5lTCTRkaEdhNP//n/KUjf/7QsQ5AEhdiwAAjN7I6jGddBCO+WGTQ1mXrYatSAgaykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==";
1075
+    NSString *scr;
1076
+    if (initialSetup) {
1077
+        scr = [NSString stringWithFormat:@"var s=new Audio('%@');s.id='wkwebviewAudio';s.controls=false;s.loop=true;s.play();document.body.appendChild(s);true", mp3Str];
1078
+    } else {
1079
+        scr = [NSString stringWithFormat:@"var s=document.getElementById('wkwebviewAudio');s.src=null;s.parentNode.removeChild(s);s=null;s=new Audio('%@');s.id='wkwebviewAudio';s.controls=false;s.loop=true;s.play();document.body.appendChild(s);true", mp3Str];
1080
+    }
1081
+    [self evaluateJS: scr thenCall: nil];
1082
+}
1083
+
1084
+-(void)disableIgnoreSilentSwitch
1085
+{
1086
+    [self evaluateJS: @"document.getElementById('wkwebviewAudio').src=null;true" thenCall: nil];
1087
+}
1088
+
1089
+-(void)appDidBecomeActive
1090
+{
1091
+    if (_ignoreSilentHardwareSwitch) {
1092
+      [self forceIgnoreSilentHardwareSwitch:false];
1093
+    }
1094
+}
1095
+
1096
+-(void)appWillResignActive
1097
+{
1098
+  if (_ignoreSilentHardwareSwitch) {
1099
+    [self disableIgnoreSilentSwitch];
1100
+  }
1101
+}
1102
+
1034
 /**
1103
 /**
1035
  * Called when the navigation is complete.
1104
  * Called when the navigation is complete.
1036
  * @see https://fburl.com/rtys6jlb
1105
  * @see https://fburl.com/rtys6jlb
1038
 - (void)webView:(WKWebView *)webView
1107
 - (void)webView:(WKWebView *)webView
1039
   didFinishNavigation:(WKNavigation *)navigation
1108
   didFinishNavigation:(WKNavigation *)navigation
1040
 {
1109
 {
1110
+  if (_ignoreSilentHardwareSwitch) {
1111
+    [self forceIgnoreSilentHardwareSwitch:true];
1112
+  }
1113
+
1041
   if (_onLoadingFinish) {
1114
   if (_onLoadingFinish) {
1042
     _onLoadingFinish([self baseEvent]);
1115
     _onLoadingFinish([self baseEvent]);
1043
   }
1116
   }
1090
 
1163
 
1091
 - (void)setInjectedJavaScript:(NSString *)source {
1164
 - (void)setInjectedJavaScript:(NSString *)source {
1092
   _injectedJavaScript = source;
1165
   _injectedJavaScript = source;
1093
-  
1166
+
1094
   self.atEndScript = source == nil ? nil : [[WKUserScript alloc] initWithSource:source
1167
   self.atEndScript = source == nil ? nil : [[WKUserScript alloc] initWithSource:source
1095
       injectionTime:WKUserScriptInjectionTimeAtDocumentEnd
1168
       injectionTime:WKUserScriptInjectionTimeAtDocumentEnd
1096
     forMainFrameOnly:_injectedJavaScriptForMainFrameOnly];
1169
     forMainFrameOnly:_injectedJavaScriptForMainFrameOnly];
1097
-  
1170
+
1098
   if(_webView != nil){
1171
   if(_webView != nil){
1099
     [self resetupScripts:_webView.configuration];
1172
     [self resetupScripts:_webView.configuration];
1100
   }
1173
   }
1102
 
1175
 
1103
 - (void)setInjectedJavaScriptBeforeContentLoaded:(NSString *)source {
1176
 - (void)setInjectedJavaScriptBeforeContentLoaded:(NSString *)source {
1104
   _injectedJavaScriptBeforeContentLoaded = source;
1177
   _injectedJavaScriptBeforeContentLoaded = source;
1105
-  
1178
+
1106
   self.atStartScript = source == nil ? nil : [[WKUserScript alloc] initWithSource:source
1179
   self.atStartScript = source == nil ? nil : [[WKUserScript alloc] initWithSource:source
1107
        injectionTime:WKUserScriptInjectionTimeAtDocumentStart
1180
        injectionTime:WKUserScriptInjectionTimeAtDocumentStart
1108
     forMainFrameOnly:_injectedJavaScriptBeforeContentLoadedForMainFrameOnly];
1181
     forMainFrameOnly:_injectedJavaScriptBeforeContentLoadedForMainFrameOnly];
1109
-  
1182
+
1110
   if(_webView != nil){
1183
   if(_webView != nil){
1111
     [self resetupScripts:_webView.configuration];
1184
     [self resetupScripts:_webView.configuration];
1112
   }
1185
   }
1124
 
1197
 
1125
 - (void)setMessagingEnabled:(BOOL)messagingEnabled {
1198
 - (void)setMessagingEnabled:(BOOL)messagingEnabled {
1126
   _messagingEnabled = messagingEnabled;
1199
   _messagingEnabled = messagingEnabled;
1127
-  
1200
+
1128
   self.postMessageScript = _messagingEnabled ?
1201
   self.postMessageScript = _messagingEnabled ?
1129
   [
1202
   [
1130
    [WKUserScript alloc]
1203
    [WKUserScript alloc]
1144
    forMainFrameOnly:YES
1217
    forMainFrameOnly:YES
1145
    ] :
1218
    ] :
1146
   nil;
1219
   nil;
1147
-  
1220
+
1148
   if(_webView != nil){
1221
   if(_webView != nil){
1149
     [self resetupScripts:_webView.configuration];
1222
     [self resetupScripts:_webView.configuration];
1150
   }
1223
   }
1153
 - (void)resetupScripts:(WKWebViewConfiguration *)wkWebViewConfig {
1226
 - (void)resetupScripts:(WKWebViewConfiguration *)wkWebViewConfig {
1154
   [wkWebViewConfig.userContentController removeAllUserScripts];
1227
   [wkWebViewConfig.userContentController removeAllUserScripts];
1155
   [wkWebViewConfig.userContentController removeScriptMessageHandlerForName:MessageHandlerName];
1228
   [wkWebViewConfig.userContentController removeScriptMessageHandlerForName:MessageHandlerName];
1156
-  
1229
+
1157
   NSString *html5HistoryAPIShimSource = [NSString stringWithFormat:
1230
   NSString *html5HistoryAPIShimSource = [NSString stringWithFormat:
1158
     @"(function(history) {\n"
1231
     @"(function(history) {\n"
1159
     "  function notify(type) {\n"
1232
     "  function notify(type) {\n"
1176
   ];
1249
   ];
1177
   WKUserScript *script = [[WKUserScript alloc] initWithSource:html5HistoryAPIShimSource injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
1250
   WKUserScript *script = [[WKUserScript alloc] initWithSource:html5HistoryAPIShimSource injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
1178
   [wkWebViewConfig.userContentController addUserScript:script];
1251
   [wkWebViewConfig.userContentController addUserScript:script];
1179
-  
1252
+
1180
   if(_sharedCookiesEnabled) {
1253
   if(_sharedCookiesEnabled) {
1181
     // More info to sending cookies with WKWebView
1254
     // More info to sending cookies with WKWebView
1182
     // https://stackoverflow.com/questions/26573137/can-i-set-the-cookies-to-be-used-by-a-wkwebview/26577303#26577303
1255
     // https://stackoverflow.com/questions/26573137/can-i-set-the-cookies-to-be-used-by-a-wkwebview/26577303#26577303
1245
       [wkWebViewConfig.userContentController addUserScript:cookieInScript];
1318
       [wkWebViewConfig.userContentController addUserScript:cookieInScript];
1246
     }
1319
     }
1247
   }
1320
   }
1248
-  
1321
+
1249
   if(_messagingEnabled){
1322
   if(_messagingEnabled){
1250
     if (self.postMessageScript){
1323
     if (self.postMessageScript){
1251
       [wkWebViewConfig.userContentController addScriptMessageHandler:[[RNCWeakScriptMessageDelegate alloc] initWithDelegate:self]
1324
       [wkWebViewConfig.userContentController addScriptMessageHandler:[[RNCWeakScriptMessageDelegate alloc] initWithDelegate:self]
1252
                                                                        name:MessageHandlerName];
1325
                                                                        name:MessageHandlerName];
1253
       [wkWebViewConfig.userContentController addUserScript:self.postMessageScript];
1326
       [wkWebViewConfig.userContentController addUserScript:self.postMessageScript];
1254
     }
1327
     }
1255
-    // FIXME: For a separate (minor) PR: these two shouldn't be gated by messagingEnabled; just keeping consistency with previous behaviour.
1256
-    if (self.atStartScript) {
1257
-      [wkWebViewConfig.userContentController addUserScript:self.atStartScript];
1258
-    }
1259
     if (self.atEndScript) {
1328
     if (self.atEndScript) {
1260
       [wkWebViewConfig.userContentController addUserScript:self.atEndScript];
1329
       [wkWebViewConfig.userContentController addUserScript:self.atEndScript];
1261
     }
1330
     }
1262
   }
1331
   }
1332
+  // Whether or not messaging is enabled, add the startup script if it exists.
1333
+  if (self.atStartScript) {
1334
+    [wkWebViewConfig.userContentController addUserScript:self.atStartScript];
1335
+  }
1263
 }
1336
 }
1264
 
1337
 
1265
 - (NSURLRequest *)requestForSource:(id)json {
1338
 - (NSURLRequest *)requestForSource:(id)json {

ios/RNCWebViewManager.h → apple/RNCWebViewManager.h Просмотреть файл


ios/RNCWebViewManager.m → apple/RNCWebViewManager.m Просмотреть файл

34
 }
34
 }
35
 
35
 
36
 RCT_EXPORT_VIEW_PROPERTY(source, NSDictionary)
36
 RCT_EXPORT_VIEW_PROPERTY(source, NSDictionary)
37
+RCT_EXPORT_VIEW_PROPERTY(onFileDownload, RCTDirectEventBlock)
37
 RCT_EXPORT_VIEW_PROPERTY(onLoadingStart, RCTDirectEventBlock)
38
 RCT_EXPORT_VIEW_PROPERTY(onLoadingStart, RCTDirectEventBlock)
38
 RCT_EXPORT_VIEW_PROPERTY(onLoadingFinish, RCTDirectEventBlock)
39
 RCT_EXPORT_VIEW_PROPERTY(onLoadingFinish, RCTDirectEventBlock)
39
 RCT_EXPORT_VIEW_PROPERTY(onLoadingError, RCTDirectEventBlock)
40
 RCT_EXPORT_VIEW_PROPERTY(onLoadingError, RCTDirectEventBlock)
46
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptForMainFrameOnly, BOOL)
47
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptForMainFrameOnly, BOOL)
47
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoadedForMainFrameOnly, BOOL)
48
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoadedForMainFrameOnly, BOOL)
48
 RCT_EXPORT_VIEW_PROPERTY(javaScriptEnabled, BOOL)
49
 RCT_EXPORT_VIEW_PROPERTY(javaScriptEnabled, BOOL)
50
+RCT_EXPORT_VIEW_PROPERTY(javaScriptCanOpenWindowsAutomatically, BOOL)
49
 RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL)
51
 RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL)
50
 RCT_EXPORT_VIEW_PROPERTY(allowsInlineMediaPlayback, BOOL)
52
 RCT_EXPORT_VIEW_PROPERTY(allowsInlineMediaPlayback, BOOL)
51
 RCT_EXPORT_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, BOOL)
53
 RCT_EXPORT_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, BOOL)

+ 1
- 1
docs/Custom-Android.md Просмотреть файл

1
 While the built-in web view has a lot of features, it is not possible to handle every use-case in React Native. You can, however, extend the web view with native code without forking React Native or duplicating all the existing web view code.
1
 While the built-in web view has a lot of features, it is not possible to handle every use-case in React Native. You can, however, extend the web view with native code without forking React Native or duplicating all the existing web view code.
2
 
2
 
3
-Before you do this, you should be familiar with the concepts in [native UI components](https://reactnative.dev/docs/native-components-android). You should also familiarise yourself with the [native code for web views](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java), as you will have to use this as a reference when implementing new features—although a deep understanding is not required.
3
+Before you do this, you should be familiar with the concepts in [native UI components](https://reactnative.dev/docs/native-components-android). You should also familiarise yourself with the [native code for web views](https://github.com/react-native-community/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java), as you will have to use this as a reference when implementing new features—although a deep understanding is not required.
4
 
4
 
5
 ## Native Code
5
 ## Native Code
6
 
6
 

+ 5
- 11
docs/Getting-Started.md Просмотреть файл

28
 
28
 
29
 _NOTE: If you ever need to uninstall React Native WebView, run `react-native unlink react-native-webview` to unlink it._
29
 _NOTE: If you ever need to uninstall React Native WebView, run `react-native unlink react-native-webview` to unlink it._
30
 
30
 
31
-### iOS:
31
+### iOS & macOS:
32
 
32
 
33
-If using cocoapods in the `ios/` directory run
33
+If using CocoaPods, in the `ios/` or `macos/` directory run:
34
 
34
 
35
 ```
35
 ```
36
 $ pod install
36
 $ pod install
37
 ```
37
 ```
38
 
38
 
39
-For iOS, while you can manually link the old way using [react-native own tutorial](https://reactnative.dev/docs/linking-libraries-ios), we find it easier to use cocoapods.
40
-If you wish to use cocoapods and haven't set it up yet, please instead refer to [that article](https://engineering.brigad.co/demystifying-react-native-modules-linking-ae6c017a6b4a).
39
+While you can manually link the old way using [react-native own tutorial](https://reactnative.dev/docs/linking-libraries-ios), we find it easier to use CocoaPods.
40
+If you wish to use CocoaPods and haven't set it up yet, please instead refer to [that article](https://engineering.brigad.co/demystifying-react-native-modules-linking-ae6c017a6b4a).
41
 
41
 
42
 ### Android:
42
 ### Android:
43
 
43
 
54
 
54
 
55
 For Android manual installation, please refer to [this article](https://engineering.brigad.co/demystifying-react-native-modules-linking-964399ec731b) where you can find detailed step on how to link any react-native project.
55
 For Android manual installation, please refer to [this article](https://engineering.brigad.co/demystifying-react-native-modules-linking-964399ec731b) where you can find detailed step on how to link any react-native project.
56
 
56
 
57
-### macOS:
58
-
59
-Cocoapod and autolinking is not yet support for react-native macOS but is coming soon. In the meantime you must manually link.
60
-
61
-The method is nearly identical to the [manual linking method for iOS](https://reactnative.dev/docs/linking-libraries-ios#manual-linking) except that you will include the `node_modules/react-native-webview/macos/RNCWebView.xcodeproj` project in your main project and link the `RNCWebView-macOS.a` library.
62
-
63
 ### Windows:
57
 ### Windows:
64
 
58
 
65
 Autolinking is not yet supported for ReactNativeWindows. Make following additions to the given files manually:
59
 Autolinking is not yet supported for ReactNativeWindows. Make following additions to the given files manually:
77
 Add a reference to `ReactNativeWebView` to your main application project. From Visual Studio 2019:
71
 Add a reference to `ReactNativeWebView` to your main application project. From Visual Studio 2019:
78
 
72
 
79
 1. Right-click main application project > Add > Reference...
73
 1. Right-click main application project > Add > Reference...
80
-  Check `ReactNativeWebView` from Solution Projects.
74
+   Check `ReactNativeWebView` from Solution Projects.
81
 
75
 
82
 2. Modify files below to add the package providers to your main application project
76
 2. Modify files below to add the package providers to your main application project
83
 
77
 

+ 45
- 14
docs/Guide.md Просмотреть файл

55
 
55
 
56
 ### Loading local HTML files
56
 ### Loading local HTML files
57
 
57
 
58
-Sometimes you would have bundled an HTML file along with the app and would like to load the HTML asset into your WebView. To do this on iOS, you can just import the html file like any other asset as shown below.
58
+Note: This is currently not working as discussed in [#428](https://github.com/react-native-community/react-native-webview/issues/428) and [#518](https://github.com/react-native-community/react-native-webview/issues/518). Possible workarounds include bundling all assets with webpack or similar, or running a [local webserver](https://github.com/futurepress/react-native-static-server).
59
+
60
+<details><summary>Show non-working method</summary>
61
+
62
+Sometimes you would have bundled an HTML file along with the app and would like to load the HTML asset into your WebView. To do this on iOS and Windows, you can just import the html file like any other asset as shown below.
59
 
63
 
60
 ```js
64
 ```js
61
 import React, { Component } from 'react';
65
 import React, { Component } from 'react';
85
 }
89
 }
86
 ```
90
 ```
87
 
91
 
92
+</details>
93
+
88
 ### Controlling navigation state changes
94
 ### Controlling navigation state changes
89
 
95
 
90
 Sometimes you want to intercept a user tapping on a link in your webview and do something different than navigating there in the webview. Here's some example code on how you might do that using the `onNavigationStateChange` function.
96
 Sometimes you want to intercept a user tapping on a link in your webview and do something different than navigating there in the webview. Here's some example code on how you might do that using the `onNavigationStateChange` function.
99
   render() {
105
   render() {
100
     return (
106
     return (
101
       <WebView
107
       <WebView
102
-        ref={ref => (this.webview = ref)}
108
+        ref={(ref) => (this.webview = ref)}
103
         source={{ uri: 'https://reactnative.dev/' }}
109
         source={{ uri: 'https://reactnative.dev/' }}
104
         onNavigationStateChange={this.handleWebViewNavigationStateChange}
110
         onNavigationStateChange={this.handleWebViewNavigationStateChange}
105
       />
111
       />
106
     );
112
     );
107
   }
113
   }
108
 
114
 
109
-  handleWebViewNavigationStateChange = newNavState => {
115
+  handleWebViewNavigationStateChange = (newNavState) => {
110
     // newNavState looks something like this:
116
     // newNavState looks something like this:
111
     // {
117
     // {
112
     //   url?: string;
118
     //   url?: string;
226
 
232
 
227
 ##### iOS
233
 ##### iOS
228
 
234
 
229
-For iOS, all you need to do is specify the permissions in your `ios/[project]/Info.plist` file:
235
+On iOS, you are going to have to supply your own code to download files. You can supply an `onFileDownload` callback
236
+to the WebView component as a prop. If RNCWebView determines that a file download needs to take place, the URL where you can download the file
237
+will be given to `onFileDownload`. From that callback you can then download that file however you would like to do so.
238
+
239
+NOTE: iOS 13+ is needed for the best possible download experience. On iOS 13 Apple added an API for accessing HTTP response headers, which
240
+is used to determine if an HTTP response should be a download. On iOS 12 or older, only MIME types that cannot be rendered by the webview will
241
+trigger calls to `onFileDownload`.
242
+
243
+Example:
244
+
245
+```javascript
246
+onFileDownload = ({ nativeEvent }) => {
247
+  const { downloadUrl } = nativeEvent;
248
+  // --> Your download code goes here <--
249
+};
250
+```
230
 
251
 
231
-Save to gallery:
252
+To be able to save images to the gallery you need to specify this permission in your `ios/[project]/Info.plist` file:
232
 
253
 
233
 ```
254
 ```
234
 <key>NSPhotoLibraryAddUsageDescription</key>
255
 <key>NSPhotoLibraryAddUsageDescription</key>
237
 
258
 
238
 ##### Android
259
 ##### Android
239
 
260
 
240
-Add permission in AndroidManifest.xml:
261
+On Android, integration with the DownloadManager is built-in.
262
+Add this permisison in AndroidManifest.xml (only required if your app supports Android versions lower than 10):
241
 
263
 
242
 ```xml
264
 ```xml
243
 <manifest ...>
265
 <manifest ...>
244
   ......
266
   ......
245
 
267
 
246
-  <!-- this is required to save files on Android  -->
268
+  <!-- this is required to save files on Android versions lower than 10 -->
247
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
269
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
248
 
270
 
249
   ......
271
   ......
293
 
315
 
294
 This runs the JavaScript in the `runFirst` string once the page is loaded. In this case, you can see that both the body style was changed to red and the alert showed up after 2 seconds.
316
 This runs the JavaScript in the `runFirst` string once the page is loaded. In this case, you can see that both the body style was changed to red and the alert showed up after 2 seconds.
295
 
317
 
296
-By setting `injectedJavaScriptForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the top frame) if supported for the given platform.
318
+By setting `injectedJavaScriptForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the main frame) if supported for the given platform. For example, if a page contains an iframe, the javascript will be injected into that iframe as well with this set to `false`. (Note this is not supported on Android.) There is also `injectedJavaScriptBeforeContentLoadedForMainFrameOnly` for injecting prior to content loading. Read more about this in the [Reference](./Reference.md#injectedjavascriptformainframeonly).
297
 
319
 
298
 <img alt="screenshot of Github repo" width="200" src="https://user-images.githubusercontent.com/1479215/53609254-e5dc9c00-3b7a-11e9-9118-bc4e520ce6ca.png" />
320
 <img alt="screenshot of Github repo" width="200" src="https://user-images.githubusercontent.com/1479215/53609254-e5dc9c00-3b7a-11e9-9118-bc4e520ce6ca.png" />
299
 
321
 
334
 
356
 
335
 This runs the JavaScript in the `runFirst` string before the page is loaded. In this case, the value of `window.isNativeApp` will be set to true before the web code executes.
357
 This runs the JavaScript in the `runFirst` string before the page is loaded. In this case, the value of `window.isNativeApp` will be set to true before the web code executes.
336
 
358
 
337
-By setting `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the top frame) if supported for the given platform. Howver, although support for `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false` has been implemented for iOS and macOS, [it is not clear](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-600275750) that it is actually possible to inject JS into iframes at this point in the page lifecycle, and so relying on the expected behaviour of this prop when set to `false` is not recommended.
359
+By setting `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the top frame) if supported for the given platform. However, although support for `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false` has been implemented for iOS and macOS, [it is not clear](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-600275750) that it is actually possible to inject JS into iframes at this point in the page lifecycle, and so relying on the expected behaviour of this prop when set to `false` is not recommended.
338
 
360
 
339
 > On iOS, ~~`injectedJavaScriptBeforeContentLoaded` runs a method on WebView called `evaluateJavaScript:completionHandler:`~~ – this is no longer true as of version `8.2.0`. Instead, we use a `WKUserScript` with injection time `WKUserScriptInjectionTimeAtDocumentStart`. As a consequence, `injectedJavaScriptBeforeContentLoaded` no longer returns an evaluation value nor logs a warning to the console. In the unlikely event that your app depended upon this behaviour, please see migration steps [here](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-574919464) to retain equivalent behaviour.
361
 > On iOS, ~~`injectedJavaScriptBeforeContentLoaded` runs a method on WebView called `evaluateJavaScript:completionHandler:`~~ – this is no longer true as of version `8.2.0`. Instead, we use a `WKUserScript` with injection time `WKUserScriptInjectionTimeAtDocumentStart`. As a consequence, `injectedJavaScriptBeforeContentLoaded` no longer returns an evaluation value nor logs a warning to the console. In the unlikely event that your app depended upon this behaviour, please see migration steps [here](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-574919464) to retain equivalent behaviour.
340
 > On Android, `injectedJavaScript` runs a method on the Android WebView called `evaluateJavascriptWithFallback`
362
 > On Android, `injectedJavaScript` runs a method on the Android WebView called `evaluateJavascriptWithFallback`
363
+> Note on Android Compatibility: For applications targeting `Build.VERSION_CODES.N` or later, JavaScript state from an empty WebView is no longer persisted across navigations like `loadUrl(java.lang.String)`. For example, global variables and functions defined before calling `loadUrl(java.lang.String)` will not exist in the loaded page. Applications should use the Android Native API `addJavascriptInterface(Object, String)` instead to persist JavaScript objects across navigations.
341
 
364
 
342
 #### The `injectJavaScript` method
365
 #### The `injectJavaScript` method
343
 
366
 
362
     return (
385
     return (
363
       <View style={{ flex: 1 }}>
386
       <View style={{ flex: 1 }}>
364
         <WebView
387
         <WebView
365
-          ref={r => (this.webref = r)}
388
+          ref={(r) => (this.webref = r)}
366
           source={{
389
           source={{
367
             uri:
390
             uri:
368
               'https://github.com/react-native-community/react-native-webview',
391
               'https://github.com/react-native-community/react-native-webview',
415
       <View style={{ flex: 1 }}>
438
       <View style={{ flex: 1 }}>
416
         <WebView
439
         <WebView
417
           source={{ html }}
440
           source={{ html }}
418
-          onMessage={event => {
441
+          onMessage={(event) => {
419
             alert(event.nativeEvent.data);
442
             alert(event.nativeEvent.data);
420
           }}
443
           }}
421
         />
444
         />
451
 In order to work around this, you can track the current URL, intercept new page loads, and navigate to them yourself ([original credit for this technique to Chirag Shah from Big Binary](https://blog.bigbinary.com/2016/07/26/passing-request-headers-on-each-webview-request-in-react-native.html)):
474
 In order to work around this, you can track the current URL, intercept new page loads, and navigate to them yourself ([original credit for this technique to Chirag Shah from Big Binary](https://blog.bigbinary.com/2016/07/26/passing-request-headers-on-each-webview-request-in-react-native.html)):
452
 
475
 
453
 ```jsx
476
 ```jsx
454
-const CustomHeaderWebView = props => {
477
+const CustomHeaderWebView = (props) => {
455
   const { uri, onLoadStart, ...restProps } = props;
478
   const { uri, onLoadStart, ...restProps } = props;
456
   const [currentURI, setURI] = useState(props.source.uri);
479
   const [currentURI, setURI] = useState(props.source.uri);
457
   const newSource = { ...props.source, uri: currentURI };
480
   const newSource = { ...props.source, uri: currentURI };
460
     <WebView
483
     <WebView
461
       {...restProps}
484
       {...restProps}
462
       source={newSource}
485
       source={newSource}
463
-      onShouldStartLoadWithRequest={request => {
486
+      onShouldStartLoadWithRequest={(request) => {
464
         // If we're loading the current URI, allow it to load
487
         // If we're loading the current URI, allow it to load
465
         if (request.url === currentURI) return true;
488
         if (request.url === currentURI) return true;
466
         // We're loading a new URL -- change state first
489
         // We're loading a new URL -- change state first
485
 
508
 
486
 You can set cookies on the React Native side using the [@react-native-community/cookies](https://github.com/react-native-community/cookies) package.
509
 You can set cookies on the React Native side using the [@react-native-community/cookies](https://github.com/react-native-community/cookies) package.
487
 
510
 
488
-When you do, you'll likely want to enable the [sharedCookiesEnabled](Reference#sharedCookiesEnabled) prop as well.
511
+When you do, you'll likely want to enable the [sharedCookiesEnabled](Reference.md#sharedCookiesEnabled) prop as well.
489
 
512
 
490
 ```jsx
513
 ```jsx
491
 const App = () => {
514
 const App = () => {
517
 ```
540
 ```
518
 
541
 
519
 Note that these cookies will only be sent on the first request unless you use the technique above for [setting custom headers on each page load](#Setting-Custom-Headers).
542
 Note that these cookies will only be sent on the first request unless you use the technique above for [setting custom headers on each page load](#Setting-Custom-Headers).
543
+
544
+### Hardware Silence Switch
545
+
546
+There are some inconsistencies in how the hardware silence switch is handled between embedded `audio` and `video` elements and between iOS and Android platforms.
547
+
548
+Audio on `iOS` will be muted when the hardware silence switch is in the on position, unless the `ignoreSilentHardwareSwitch` parameter is set to true.
549
+
550
+Video on `iOS` will always ignore the hardware silence switch.

+ 5
- 1
docs/README.portuguese.md Просмотреть файл

19
 
19
 
20
 - [x] iOS
20
 - [x] iOS
21
 - [x] Android
21
 - [x] Android
22
+- [x] macOS
23
+- [x] Windows
22
 
24
 
23
 _Nota: O suporte da Expo para o React Native WebView começou com [Expo SDK v33.0.0](https://blog.expo.io/expo-sdk-v33-0-0-is-now-available-52d1c99dfe4c)._
25
 _Nota: O suporte da Expo para o React Native WebView começou com [Expo SDK v33.0.0](https://blog.expo.io/expo-sdk-v33-0-0-is-now-available-52d1c99dfe4c)._
24
 
26
 
34
 
36
 
35
 Versão atual: ![version](https://img.shields.io/npm/v/react-native-webview.svg)
37
 Versão atual: ![version](https://img.shields.io/npm/v/react-native-webview.svg)
36
 
38
 
37
-- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - UIWebView removido
39
+- [8.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange agora é disparado quando alterado o hash da URL.
40
+
41
+- [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - UIWebView removido.
38
 
42
 
39
 - [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update para AndroidX. Tenha certeza de habilitar no `android/gradle.properties` do seu projeto. Veja o [Getting Started Guide](https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md).
43
 - [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update para AndroidX. Tenha certeza de habilitar no `android/gradle.properties` do seu projeto. Veja o [Getting Started Guide](https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md).
40
 
44
 

+ 141
- 80
docs/Reference.md Просмотреть файл

32
 - [`decelerationRate`](Reference.md#decelerationrate)
32
 - [`decelerationRate`](Reference.md#decelerationrate)
33
 - [`domStorageEnabled`](Reference.md#domstorageenabled)
33
 - [`domStorageEnabled`](Reference.md#domstorageenabled)
34
 - [`javaScriptEnabled`](Reference.md#javascriptenabled)
34
 - [`javaScriptEnabled`](Reference.md#javascriptenabled)
35
+- [`javaScriptCanOpenWindowsAutomatically`](Reference.md#javascriptcanopenwindowsautomatically)
35
 - [`androidHardwareAccelerationDisabled`](Reference.md#androidHardwareAccelerationDisabled)
36
 - [`androidHardwareAccelerationDisabled`](Reference.md#androidHardwareAccelerationDisabled)
36
 - [`mixedContentMode`](Reference.md#mixedcontentmode)
37
 - [`mixedContentMode`](Reference.md#mixedcontentmode)
37
 - [`thirdPartyCookiesEnabled`](Reference.md#thirdpartycookiesenabled)
38
 - [`thirdPartyCookiesEnabled`](Reference.md#thirdpartycookiesenabled)
64
 - [`allowsLinkPreview`](Reference.md#allowsLinkPreview)
65
 - [`allowsLinkPreview`](Reference.md#allowsLinkPreview)
65
 - [`sharedCookiesEnabled`](Reference.md#sharedCookiesEnabled)
66
 - [`sharedCookiesEnabled`](Reference.md#sharedCookiesEnabled)
66
 - [`textZoom`](Reference.md#textZoom)
67
 - [`textZoom`](Reference.md#textZoom)
68
+- [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
69
+- [`onFileDownload`](Reference.md#onFileDownload)
67
 
70
 
68
 ## Methods Index
71
 ## Methods Index
69
 
72
 
77
 - [`clearCache`](Reference.md#clearCache)
80
 - [`clearCache`](Reference.md#clearCache)
78
 - [`clearHistory`](Reference.md#clearHistory)
81
 - [`clearHistory`](Reference.md#clearHistory)
79
 - [`requestFocus`](Reference.md#requestFocus)
82
 - [`requestFocus`](Reference.md#requestFocus)
83
+- [`postMessage`](Reference.md#postMessage)
80
 
84
 
81
 ---
85
 ---
82
 
86
 
84
 
88
 
85
 ## Props
89
 ## Props
86
 
90
 
87
-### `source`
91
+### `source`[⬆](#props-index)<!-- Link generated with jump2header -->
88
 
92
 
89
 Loads static HTML or a URI (with optional headers) in the WebView. Note that static HTML will require setting [`originWhitelist`](Reference.md#originwhitelist) to `["*"]`.
93
 Loads static HTML or a URI (with optional headers) in the WebView. Note that static HTML will require setting [`originWhitelist`](Reference.md#originwhitelist) to `["*"]`.
90
 
94
 
110
 
114
 
111
 ---
115
 ---
112
 
116
 
113
-### `automaticallyAdjustContentInsets`
117
+### `automaticallyAdjustContentInsets`[⬆](#props-index)<!-- Link generated with jump2header -->
114
 
118
 
115
 Controls whether to adjust the content inset for web views that are placed behind a navigation bar, tab bar, or toolbar. The default value is `true`.
119
 Controls whether to adjust the content inset for web views that are placed behind a navigation bar, tab bar, or toolbar. The default value is `true`.
116
 
120
 
120
 
124
 
121
 ---
125
 ---
122
 
126
 
123
-### `injectedJavaScript`
127
+### `injectedJavaScript`[⬆](#props-index)<!-- Link generated with jump2header -->
124
 
128
 
125
 Set this to provide JavaScript that will be injected into the web page after the document finishes loading, but before other subresources finish loading.
129
 Set this to provide JavaScript that will be injected into the web page after the document finishes loading, but before other subresources finish loading.
126
 
130
 
152
 
156
 
153
 ---
157
 ---
154
 
158
 
155
-### `injectedJavaScriptBeforeContentLoaded`
159
+### `injectedJavaScriptBeforeContentLoaded`[⬆](#props-index)<!-- Link generated with jump2header -->
156
 
160
 
157
 Set this to provide JavaScript that will be injected into the web page after the document element is created, but before other subresources finish loading.
161
 Set this to provide JavaScript that will be injected into the web page after the document element is created, but before other subresources finish loading.
158
 
162
 
184
 
188
 
185
 ---
189
 ---
186
 
190
 
187
-### `injectedJavaScriptForMainFrameOnly`
191
+### `injectedJavaScriptForMainFrameOnly`[⬆](#props-index)<!-- Link generated with jump2header -->
188
 
192
 
189
-If `true` (default), loads the `injectedJavaScript` only into the main frame.
193
+If `true` (default; mandatory for Android), loads the `injectedJavaScript` only into the main frame.
190
 
194
 
191
-If `false`, loads it into all frames (e.g. iframes).
195
+If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
192
 
196
 
193
 | Type   | Required | Platform |
197
 | Type   | Required | Platform |
194
 | ------ | -------- | -------- |
198
 | ------ | -------- | -------- |
195
-| bool | No       | iOS, macOS       |
199
+| bool | No       | iOS and macOS (only `true` supported for Android) |
196
 
200
 
197
 ---
201
 ---
198
 
202
 
199
-### `injectedJavaScriptBeforeContentLoadedForMainFrameOnly`
203
+### `injectedJavaScriptBeforeContentLoadedForMainFrameOnly`[⬆](#props-index)<!-- Link generated with jump2header -->
200
 
204
 
201
-If `true` (default), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
205
+If `true` (default; mandatory for Android), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
202
 
206
 
203
-If `false`, loads it into all frames (e.g. iframes).
204
-
205
-Warning: although support for `injectedJavaScriptBeforeContentLoadedForMainFrameOnly: false` has been implemented for iOS and macOS, [it is not clear](https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-600275750) that it is actually possible to inject JS into iframes at this point in the page lifecycle, and so relying on the expected behaviour of this prop when set to `false` is not recommended.
207
+If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
206
 
208
 
207
 | Type   | Required | Platform |
209
 | Type   | Required | Platform |
208
 | ------ | -------- | -------- |
210
 | ------ | -------- | -------- |
209
-| bool | No       | iOS, macOS       |
211
+| bool | No       | iOS and macOS (only `true` supported for Android) |
210
 
212
 
211
 ---
213
 ---
212
 
214
 
213
-### `mediaPlaybackRequiresUserAction`
215
+### `mediaPlaybackRequiresUserAction`[⬆](#props-index)<!-- Link generated with jump2header -->
214
 
216
 
215
 Boolean that determines whether HTML5 audio and video requires the user to tap them before they start playing. The default value is `true`. (Android API minimum version 17).
217
 Boolean that determines whether HTML5 audio and video requires the user to tap them before they start playing. The default value is `true`. (Android API minimum version 17).
216
 
218
 
222
 
224
 
223
 ---
225
 ---
224
 
226
 
225
-### `nativeConfig`
227
+### `nativeConfig`[⬆](#props-index)<!-- Link generated with jump2header -->
226
 
228
 
227
 Override the native component used to render the WebView. Enables a custom native WebView which uses the same JavaScript as the original WebView.
229
 Override the native component used to render the WebView. Enables a custom native WebView which uses the same JavaScript as the original WebView.
228
 
230
 
238
 
240
 
239
 ---
241
 ---
240
 
242
 
241
-### `onError`
243
+### `onError`[⬆](#props-index)<!-- Link generated with jump2header -->
242
 
244
 
243
 Function that is invoked when the `WebView` load fails.
245
 Function that is invoked when the `WebView` load fails.
244
 
246
 
278
 
280
 
279
 ---
281
 ---
280
 
282
 
281
-### `onLoad`
283
+### `onLoad`[⬆](#props-index)<!-- Link generated with jump2header -->
282
 
284
 
283
 Function that is invoked when the `WebView` has finished loading.
285
 Function that is invoked when the `WebView` has finished loading.
284
 
286
 
311
 
313
 
312
 ---
314
 ---
313
 
315
 
314
-### `onLoadEnd`
316
+### `onLoadEnd`[⬆](#props-index)<!-- Link generated with jump2header -->
315
 
317
 
316
 Function that is invoked when the `WebView` load succeeds or fails.
318
 Function that is invoked when the `WebView` load succeeds or fails.
317
 
319
 
345
 
347
 
346
 ---
348
 ---
347
 
349
 
348
-### `onLoadStart`
350
+### `onLoadStart`[⬆](#props-index)<!-- Link generated with jump2header -->
349
 
351
 
350
 Function that is invoked when the `WebView` starts loading.
352
 Function that is invoked when the `WebView` starts loading.
351
 
353
 
379
 
381
 
380
 ---
382
 ---
381
 
383
 
382
-### `onLoadProgress`
384
+### `onLoadProgress`[⬆](#props-index)<!-- Link generated with jump2header -->
383
 
385
 
384
 Function that is invoked when the `WebView` is loading.
386
 Function that is invoked when the `WebView` is loading.
385
 
387
 
412
 
414
 
413
 ---
415
 ---
414
 
416
 
415
-### `onHttpError`
417
+### `onHttpError`[⬆](#props-index)<!-- Link generated with jump2header -->
416
 
418
 
417
 Function that is invoked when the `WebView` receives an http error.
419
 Function that is invoked when the `WebView` receives an http error.
418
 
420
 
456
 
458
 
457
 ---
459
 ---
458
 
460
 
459
-### `onMessage`
461
+### `onMessage`[⬆](#props-index)<!-- Link generated with jump2header -->
460
 
462
 
461
 Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`. Setting this property will inject this global into your webview.
463
 Function that is invoked when the webview calls `window.ReactNativeWebView.postMessage`. Setting this property will inject this global into your webview.
462
 
464
 
470
 
472
 
471
 ---
473
 ---
472
 
474
 
473
-### `onNavigationStateChange`
475
+### `onNavigationStateChange`[⬆](#props-index)<!-- Link generated with jump2header -->
474
 
476
 
475
 Function that is invoked when the `WebView` loading starts or ends.
477
 Function that is invoked when the `WebView` loading starts or ends.
476
 
478
 
506
 
508
 
507
 ---
509
 ---
508
 
510
 
509
-### `onContentProcessDidTerminate`
511
+### `onContentProcessDidTerminate`[⬆](#props-index)<!-- Link generated with jump2header -->
510
 
512
 
511
 Function that is invoked when the `WebView` content process is terminated.
513
 Function that is invoked when the `WebView` content process is terminated.
512
 
514
 
540
 
542
 
541
 ---
543
 ---
542
 
544
 
543
-### `originWhitelist`
545
+### `originWhitelist`[⬆](#props-index)<!-- Link generated with jump2header -->
544
 
546
 
545
 List of origin strings to allow being navigated to. The strings allow wildcards and get matched against _just_ the origin (not the full URL). If the user taps to navigate to a new page but the new page is not in this whitelist, the URL will be handled by the OS. The default whitelisted origins are "http://*" and "https://*".
547
 List of origin strings to allow being navigated to. The strings allow wildcards and get matched against _just_ the origin (not the full URL). If the user taps to navigate to a new page but the new page is not in this whitelist, the URL will be handled by the OS. The default whitelisted origins are "http://*" and "https://*".
546
 
548
 
560
 
562
 
561
 ---
563
 ---
562
 
564
 
563
-### `renderError`
565
+### `renderError`[⬆](#props-index)<!-- Link generated with jump2header -->
564
 
566
 
565
 Function that returns a view to show if there's an error.
567
 Function that returns a view to show if there's an error.
566
 
568
 
581
 
583
 
582
 ---
584
 ---
583
 
585
 
584
-### `renderLoading`
586
+### `renderLoading`[⬆](#props-index)<!-- Link generated with jump2header -->
585
 
587
 
586
 Function that returns a loading indicator. The startInLoadingState prop must be set to true in order to use this prop.
588
 Function that returns a loading indicator. The startInLoadingState prop must be set to true in order to use this prop.
587
 
589
 
601
 
603
 
602
 ---
604
 ---
603
 
605
 
604
-### `scalesPageToFit`
606
+### `scalesPageToFit`[⬆](#props-index)<!-- Link generated with jump2header -->
605
 
607
 
606
 Boolean that controls whether the web content is scaled to fit the view and enables the user to change the scale. The default value is `true`.
608
 Boolean that controls whether the web content is scaled to fit the view and enables the user to change the scale. The default value is `true`.
607
 
609
 
611
 
613
 
612
 ---
614
 ---
613
 
615
 
614
-### `onShouldStartLoadWithRequest`
616
+### `onShouldStartLoadWithRequest`[⬆](#props-index)<!-- Link generated with jump2header -->
615
 
617
 
616
 Function that allows custom handling of any web view requests. Return `true` from the function to continue loading the request and `false` to stop loading.
618
 Function that allows custom handling of any web view requests. Return `true` from the function to continue loading the request and `false` to stop loading.
617
 
619
 
649
 
651
 
650
 ---
652
 ---
651
 
653
 
652
-### `startInLoadingState`
654
+### `startInLoadingState`[⬆](#props-index)<!-- Link generated with jump2header -->
653
 
655
 
654
 Boolean value that forces the `WebView` to show the loading view on the first load. This prop must be set to `true` in order for the `renderLoading` prop to work.
656
 Boolean value that forces the `WebView` to show the loading view on the first load. This prop must be set to `true` in order for the `renderLoading` prop to work.
655
 
657
 
659
 
661
 
660
 ---
662
 ---
661
 
663
 
662
-### `style`
664
+### `style`[⬆](#props-index)<!-- Link generated with jump2header -->
663
 
665
 
664
 A style object that allow you to customize the `WebView` style. Please note that there are default styles (example: you need to add `flex: 0` to the style if you want to use `height` property).
666
 A style object that allow you to customize the `WebView` style. Please note that there are default styles (example: you need to add `flex: 0` to the style if you want to use `height` property).
665
 
667
 
678
 
680
 
679
 ---
681
 ---
680
 
682
 
681
-### `containerStyle`
683
+### `containerStyle`[⬆](#props-index)<!-- Link generated with jump2header -->
682
 
684
 
683
 A style object that allow you to customize the `WebView` container style. Please note that there are default styles (example: you need to add `flex: 0` to the style if you want to use `height` property).
685
 A style object that allow you to customize the `WebView` container style. Please note that there are default styles (example: you need to add `flex: 0` to the style if you want to use `height` property).
684
 
686
 
697
 
699
 
698
 ---
700
 ---
699
 
701
 
700
-### `decelerationRate`
702
+### `decelerationRate`[⬆](#props-index)<!-- Link generated with jump2header -->
701
 
703
 
702
 A floating-point number that determines how quickly the scroll view decelerates after the user lifts their finger. You may also use the string shortcuts `"normal"` and `"fast"` which match the underlying iOS settings for `UIScrollViewDecelerationRateNormal` and `UIScrollViewDecelerationRateFast` respectively:
704
 A floating-point number that determines how quickly the scroll view decelerates after the user lifts their finger. You may also use the string shortcuts `"normal"` and `"fast"` which match the underlying iOS settings for `UIScrollViewDecelerationRateNormal` and `UIScrollViewDecelerationRateFast` respectively:
703
 
705
 
710
 
712
 
711
 ---
713
 ---
712
 
714
 
713
-### `domStorageEnabled`
715
+### `domStorageEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
714
 
716
 
715
 Boolean value to control whether DOM Storage is enabled. Used only in Android.
717
 Boolean value to control whether DOM Storage is enabled. Used only in Android.
716
 
718
 
720
 
722
 
721
 ---
723
 ---
722
 
724
 
723
-### `javaScriptEnabled`
725
+### `javaScriptEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
724
 
726
 
725
 Boolean value to enable JavaScript in the `WebView`. The default value is `true`.
727
 Boolean value to enable JavaScript in the `WebView`. The default value is `true`.
726
 
728
 
730
 
732
 
731
 ---
733
 ---
732
 
734
 
733
-### `androidHardwareAccelerationDisabled`
735
+### `javaScriptCanOpenWindowsAutomatically`[⬆](#props-index)<!-- Link generated with jump2header -->
736
+
737
+A Boolean value indicating whether JavaScript can open windows without user interaction. The default value is `false`.
738
+
739
+| Type | Required |
740
+| ---- | -------- |
741
+| bool | No       |
742
+
743
+---
744
+
745
+### `androidHardwareAccelerationDisabled`[⬆](#props-index)<!-- Link generated with jump2header -->
734
 
746
 
735
 Boolean value to disable Hardware Acceleration in the `WebView`. Used on Android only as Hardware Acceleration is a feature only for Android. The default value is `false`.
747
 Boolean value to disable Hardware Acceleration in the `WebView`. Used on Android only as Hardware Acceleration is a feature only for Android. The default value is `false`.
736
 
748
 
740
 
752
 
741
 ---
753
 ---
742
 
754
 
743
-### `mixedContentMode`
755
+### `mixedContentMode`[⬆](#props-index)<!-- Link generated with jump2header -->
744
 
756
 
745
 Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
757
 Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
746
 
758
 
756
 
768
 
757
 ---
769
 ---
758
 
770
 
759
-### `thirdPartyCookiesEnabled`
771
+### `thirdPartyCookiesEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
760
 
772
 
761
 Boolean value to enable third party cookies in the `WebView`. Used on Android Lollipop and above only as third party cookies are enabled by default on Android Kitkat and below and on iOS. The default value is `true`. For more on cookies, read the [Guide](Guide.md#Managing-Cookies)
773
 Boolean value to enable third party cookies in the `WebView`. Used on Android Lollipop and above only as third party cookies are enabled by default on Android Kitkat and below and on iOS. The default value is `true`. For more on cookies, read the [Guide](Guide.md#Managing-Cookies)
762
 
774
 
766
 
778
 
767
 ---
779
 ---
768
 
780
 
769
-### `userAgent`
781
+### `userAgent`[⬆](#props-index)<!-- Link generated with jump2header -->
770
 
782
 
771
 Sets the user-agent for the `WebView`.
783
 Sets the user-agent for the `WebView`.
772
 
784
 
776
 
788
 
777
 ---
789
 ---
778
 
790
 
779
-### `applicationNameForUserAgent`
791
+### `applicationNameForUserAgent`[⬆](#props-index)<!-- Link generated with jump2header -->
780
 
792
 
781
 Append to the existing user-agent. Setting `userAgent` will override this.
793
 Append to the existing user-agent. Setting `userAgent` will override this.
782
 
794
 
794
 // Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 DemoApp/1.1.0
806
 // Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 DemoApp/1.1.0
795
 ```
807
 ```
796
 
808
 
797
-### `allowsFullscreenVideo`
809
+### `allowsFullscreenVideo`[⬆](#props-index)<!-- Link generated with jump2header -->
798
 
810
 
799
 Boolean that determines whether videos are allowed to be played in fullscreen. The default value is `false`.
811
 Boolean that determines whether videos are allowed to be played in fullscreen. The default value is `false`.
800
 
812
 
804
 
816
 
805
 ---
817
 ---
806
 
818
 
807
-### `allowsInlineMediaPlayback`
819
+### `allowsInlineMediaPlayback`[⬆](#props-index)<!-- Link generated with jump2header -->
808
 
820
 
809
 Boolean that determines whether HTML5 videos play inline or use the native full-screen controller. The default value is `false`.
821
 Boolean that determines whether HTML5 videos play inline or use the native full-screen controller. The default value is `false`.
810
 
822
 
818
 
830
 
819
 ---
831
 ---
820
 
832
 
821
-### `bounces`
833
+### `bounces`[⬆](#props-index)<!-- Link generated with jump2header -->
822
 
834
 
823
 Boolean value that determines whether the web view bounces when it reaches the edge of the content. The default value is `true`.
835
 Boolean value that determines whether the web view bounces when it reaches the edge of the content. The default value is `true`.
824
 
836
 
828
 
840
 
829
 ---
841
 ---
830
 
842
 
831
-### `overScrollMode`
843
+### `overScrollMode`[⬆](#props-index)<!-- Link generated with jump2header -->
832
 
844
 
833
 Specifies the over scroll mode.
845
 Specifies the over scroll mode.
834
 
846
 
844
 
856
 
845
 ---
857
 ---
846
 
858
 
847
-### `contentInset`
859
+### `contentInset`[⬆](#props-index)<!-- Link generated with jump2header -->
848
 
860
 
849
 The amount by which the web view content is inset from the edges of the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
861
 The amount by which the web view content is inset from the edges of the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
850
 
862
 
854
 
866
 
855
 ---
867
 ---
856
 
868
 
857
-### `contentInsetAdjustmentBehavior`
869
+### `contentInsetAdjustmentBehavior`[⬆](#props-index)<!-- Link generated with jump2header -->
858
 
870
 
859
 This property specifies how the safe area insets are used to modify the content area of the scroll view. The default value of this property is "never". Available on iOS 11 and later. Defaults to `never`.
871
 This property specifies how the safe area insets are used to modify the content area of the scroll view. The default value of this property is "never". Available on iOS 11 and later. Defaults to `never`.
860
 
872
 
871
 
883
 
872
 ---
884
 ---
873
 
885
 
874
-### `dataDetectorTypes`
886
+### `dataDetectorTypes`[⬆](#props-index)<!-- Link generated with jump2header -->
875
 
887
 
876
 Determines the types of data converted to clickable URLs in the web view's content. By default only phone numbers are detected.
888
 Determines the types of data converted to clickable URLs in the web view's content. By default only phone numbers are detected.
877
 
889
 
895
 
907
 
896
 ---
908
 ---
897
 
909
 
898
-### `scrollEnabled`
910
+### `scrollEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
899
 
911
 
900
 Boolean value that determines whether scrolling is enabled in the `WebView`. The default value is `true`. Setting this to `false` will prevent the webview from moving the document body when the keyboard appears over an input.
912
 Boolean value that determines whether scrolling is enabled in the `WebView`. The default value is `true`. Setting this to `false` will prevent the webview from moving the document body when the keyboard appears over an input.
901
 
913
 
905
 
917
 
906
 ---
918
 ---
907
 
919
 
908
-### `directionalLockEnabled`
920
+### `directionalLockEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
909
 
921
 
910
 A Boolean value that determines whether scrolling is disabled in a particular direction.
922
 A Boolean value that determines whether scrolling is disabled in a particular direction.
911
 The default value is `true`.
923
 The default value is `true`.
916
 
928
 
917
 ---
929
 ---
918
 
930
 
919
-### `showsHorizontalScrollIndicator`
931
+### `showsHorizontalScrollIndicator`[⬆](#props-index)<!-- Link generated with jump2header -->
920
 
932
 
921
 Boolean value that determines whether a horizontal scroll indicator is shown in the `WebView`. The default value is `true`.
933
 Boolean value that determines whether a horizontal scroll indicator is shown in the `WebView`. The default value is `true`.
922
 
934
 
926
 
938
 
927
 ---
939
 ---
928
 
940
 
929
-### `showsVerticalScrollIndicator`
941
+### `showsVerticalScrollIndicator`[⬆](#props-index)<!-- Link generated with jump2header -->
930
 
942
 
931
 Boolean value that determines whether a vertical scroll indicator is shown in the `WebView`. The default value is `true`.
943
 Boolean value that determines whether a vertical scroll indicator is shown in the `WebView`. The default value is `true`.
932
 
944
 
936
 
948
 
937
 ---
949
 ---
938
 
950
 
939
-### `geolocationEnabled`
951
+### `geolocationEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
940
 
952
 
941
 Set whether Geolocation is enabled in the `WebView`. The default value is `false`. Used only in Android.
953
 Set whether Geolocation is enabled in the `WebView`. The default value is `false`. Used only in Android.
942
 
954
 
946
 
958
 
947
 ---
959
 ---
948
 
960
 
949
-### `allowFileAccessFromFileURLs`
961
+### `allowFileAccessFromFileURLs`[⬆](#props-index)<!-- Link generated with jump2header -->
950
 
962
 
951
 Boolean that sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from other file scheme URLs. The default value is `false`.
963
 Boolean that sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from other file scheme URLs. The default value is `false`.
952
 
964
 
956
 
968
 
957
 ---
969
 ---
958
 
970
 
959
-### `allowUniversalAccessFromFileURLs`
971
+### `allowUniversalAccessFromFileURLs`[⬆](#props-index)<!-- Link generated with jump2header -->
960
 
972
 
961
 Boolean that sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from any origin. Including accessing content from other file scheme URLs. The default value is `false`.
973
 Boolean that sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from any origin. Including accessing content from other file scheme URLs. The default value is `false`.
962
 
974
 
966
 
978
 
967
 ---
979
 ---
968
 
980
 
969
-### `allowingReadAccessToURL`
981
+### `allowingReadAccessToURL`[⬆](#props-index)<!-- Link generated with jump2header -->
970
 
982
 
971
 A String value that indicates which URLs the WebView's file can then reference in scripts, AJAX requests, and CSS imports. This is only used in for WebViews that are loaded with a source.uri set to a `'file://'` URL. If not provided, the default is to only allow read access to the URL provided in source.uri itself.
983
 A String value that indicates which URLs the WebView's file can then reference in scripts, AJAX requests, and CSS imports. This is only used in for WebViews that are loaded with a source.uri set to a `'file://'` URL. If not provided, the default is to only allow read access to the URL provided in source.uri itself.
972
 
984
 
976
 
988
 
977
 ---
989
 ---
978
 
990
 
979
-### `url`
991
+### `url`[⬆](#props-index)<!-- Link generated with jump2header -->
980
 
992
 
981
 **Deprecated.** Use the `source` prop instead.
993
 **Deprecated.** Use the `source` prop instead.
982
 
994
 
986
 
998
 
987
 ---
999
 ---
988
 
1000
 
989
-### `html`
1001
+### `html`[⬆](#props-index)<!-- Link generated with jump2header -->
990
 
1002
 
991
 **Deprecated.** Use the `source` prop instead.
1003
 **Deprecated.** Use the `source` prop instead.
992
 
1004
 
996
 
1008
 
997
 ---
1009
 ---
998
 
1010
 
999
-### `keyboardDisplayRequiresUserAction`
1011
+### `keyboardDisplayRequiresUserAction`[⬆](#props-index)<!-- Link generated with jump2header -->
1000
 
1012
 
1001
 If false, web content can programmatically display the keyboard. The default value is `true`.
1013
 If false, web content can programmatically display the keyboard. The default value is `true`.
1002
 
1014
 
1006
 
1018
 
1007
 ---
1019
 ---
1008
 
1020
 
1009
-### `hideKeyboardAccessoryView`
1021
+### `hideKeyboardAccessoryView`[⬆](#props-index)<!-- Link generated with jump2header -->
1010
 
1022
 
1011
 If true, this will hide the keyboard accessory view (< > and Done).
1023
 If true, this will hide the keyboard accessory view (< > and Done).
1012
 
1024
 
1016
 
1028
 
1017
 ---
1029
 ---
1018
 
1030
 
1019
-### `allowsBackForwardNavigationGestures`
1031
+### `allowsBackForwardNavigationGestures`[⬆](#props-index)<!-- Link generated with jump2header -->
1020
 
1032
 
1021
 If true, this will be able horizontal swipe gestures. The default value is `false`.
1033
 If true, this will be able horizontal swipe gestures. The default value is `false`.
1022
 
1034
 
1026
 
1038
 
1027
 ---
1039
 ---
1028
 
1040
 
1029
-### `incognito`
1041
+### `incognito`[⬆](#props-index)<!-- Link generated with jump2header -->
1030
 
1042
 
1031
 Does not store any data within the lifetime of the WebView.
1043
 Does not store any data within the lifetime of the WebView.
1032
 
1044
 
1036
 
1048
 
1037
 ---
1049
 ---
1038
 
1050
 
1039
-### `allowFileAccess`
1051
+### `allowFileAccess`[⬆](#props-index)<!-- Link generated with jump2header -->
1040
 
1052
 
1041
 If true, this will allow access to the file system via `file://` URI's. The default value is `false`.
1053
 If true, this will allow access to the file system via `file://` URI's. The default value is `false`.
1042
 
1054
 
1046
 
1058
 
1047
 ---
1059
 ---
1048
 
1060
 
1049
-### `saveFormDataDisabled`
1061
+### `saveFormDataDisabled`[⬆](#props-index)<!-- Link generated with jump2header -->
1050
 
1062
 
1051
 Sets whether the WebView should disable saving form data. The default value is `false`. This function does not have any effect from Android API level 26 onwards as there is an Autofill feature which stores form data.
1063
 Sets whether the WebView should disable saving form data. The default value is `false`. This function does not have any effect from Android API level 26 onwards as there is an Autofill feature which stores form data.
1052
 
1064
 
1056
 
1068
 
1057
 ---
1069
 ---
1058
 
1070
 
1059
-### `cacheEnabled`
1071
+### `cacheEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
1060
 
1072
 
1061
 Sets whether WebView should use browser caching.
1073
 Sets whether WebView should use browser caching.
1062
 
1074
 
1066
 
1078
 
1067
 ---
1079
 ---
1068
 
1080
 
1069
-### `cacheMode`
1081
+### `cacheMode`[⬆](#props-index)<!-- Link generated with jump2header -->
1070
 
1082
 
1071
 Overrides the way the cache is used. The way the cache is used is based on the navigation type. For a normal page load, the cache is checked and content is re-validated as needed. When navigating back, content is not revalidated, instead the content is just retrieved from the cache. This property allows the client to override this behavior.
1083
 Overrides the way the cache is used. The way the cache is used is based on the navigation type. For a normal page load, the cache is checked and content is re-validated as needed. When navigating back, content is not revalidated, instead the content is just retrieved from the cache. This property allows the client to override this behavior.
1072
 
1084
 
1083
 
1095
 
1084
 ---
1096
 ---
1085
 
1097
 
1086
-### `pagingEnabled`
1098
+### `pagingEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
1087
 
1099
 
1088
 If the value of this property is true, the scroll view stops on multiples of the scroll view’s bounds when the user scrolls. The default value is false.
1100
 If the value of this property is true, the scroll view stops on multiples of the scroll view’s bounds when the user scrolls. The default value is false.
1089
 
1101
 
1093
 
1105
 
1094
 ---
1106
 ---
1095
 
1107
 
1096
-### `allowsLinkPreview`
1108
+### `allowsLinkPreview`[⬆](#props-index)<!-- Link generated with jump2header -->
1097
 
1109
 
1098
 A Boolean value that determines whether pressing on a link displays a preview of the destination for the link. In iOS this property is available on devices that support 3D Touch. In iOS 10 and later, the default value is true; before that, the default value is false.
1110
 A Boolean value that determines whether pressing on a link displays a preview of the destination for the link. In iOS this property is available on devices that support 3D Touch. In iOS 10 and later, the default value is true; before that, the default value is false.
1099
 
1111
 
1103
 
1115
 
1104
 ---
1116
 ---
1105
 
1117
 
1106
-### `sharedCookiesEnabled`
1118
+### `sharedCookiesEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
1107
 
1119
 
1108
 Set `true` if shared cookies from `[NSHTTPCookieStorage sharedHTTPCookieStorage]` should used for every load request in the WebView. The default value is `false`. For more on cookies, read the [Guide](Guide.md#Managing-Cookies)
1120
 Set `true` if shared cookies from `[NSHTTPCookieStorage sharedHTTPCookieStorage]` should used for every load request in the WebView. The default value is `false`. For more on cookies, read the [Guide](Guide.md#Managing-Cookies)
1109
 
1121
 
1113
 
1125
 
1114
 ---
1126
 ---
1115
 
1127
 
1116
-### `textZoom`
1128
+### `textZoom`[⬆](#props-index)<!-- Link generated with jump2header -->
1117
 
1129
 
1118
 If the user has set a custom font size in the Android system, an undesirable scale of the site interface in WebView occurs.
1130
 If the user has set a custom font size in the Android system, an undesirable scale of the site interface in WebView occurs.
1119
 
1131
 
1127
 
1139
 
1128
 `<WebView textZoom={100} />`
1140
 `<WebView textZoom={100} />`
1129
 
1141
 
1142
+### `ignoreSilentHardwareSwitch`[⬆](#props-index)<!-- Link generated with jump2header -->
1143
+
1144
+(ios only)
1145
+
1146
+When set to true the hardware silent switch is ignored. Default: `false`
1147
+
1148
+| Type    | Required | Platform |
1149
+| ------- | -------- | -------- |
1150
+| boolean | No       | iOS      |
1151
+
1152
+### `onFileDownload`[⬆](#props-index)<!-- Link generated with jump2header -->
1153
+This property is iOS-only.
1154
+
1155
+Function that is invoked when the client needs to download a file.
1156
+
1157
+iOS 13+ only: If the webview navigates to a URL that results in an HTTP
1158
+response with a Content-Disposition header 'attachment...', then
1159
+this will be called.
1160
+
1161
+iOS 8+: If the MIME type indicates that the content is not renderable by the
1162
+webview, that will also cause this to be called. On iOS versions before 13,
1163
+this is the only condition that will cause this function to be called.
1164
+
1165
+The application will need to provide its own code to actually download
1166
+the file.
1167
+
1168
+If not provided, the default is to let the webview try to render the file.
1169
+
1170
+Example:
1171
+```jsx
1172
+<WebView
1173
+  source={{ uri: 'https://reactnative.dev' }}
1174
+  onFileDownload={ ( { nativeEvent: { downloadUrl } } ) => {
1175
+    // You use downloadUrl which is a string to download files however you want.
1176
+  }}
1177
+  />
1178
+```
1179
+
1180
+| Type    | Required | Platform |
1181
+| ------- | -------- | -------- |
1182
+| function | No       | iOS      |
1183
+
1130
 ## Methods
1184
 ## Methods
1131
 
1185
 
1132
-### `extraNativeComponentConfig()`
1186
+### `extraNativeComponentConfig()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1133
 
1187
 
1134
 ```javascript
1188
 ```javascript
1135
 static extraNativeComponentConfig()
1189
 static extraNativeComponentConfig()
1136
 ```
1190
 ```
1137
 
1191
 
1138
-### `goForward()`
1192
+### `goForward()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1139
 
1193
 
1140
 ```javascript
1194
 ```javascript
1141
 goForward();
1195
 goForward();
1143
 
1197
 
1144
 Go forward one page in the web view's history.
1198
 Go forward one page in the web view's history.
1145
 
1199
 
1146
-### `goBack()`
1200
+### `goBack()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1147
 
1201
 
1148
 ```javascript
1202
 ```javascript
1149
 goBack();
1203
 goBack();
1151
 
1205
 
1152
 Go back one page in the web view's history.
1206
 Go back one page in the web view's history.
1153
 
1207
 
1154
-### `reload()`
1208
+### `reload()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1155
 
1209
 
1156
 ```javascript
1210
 ```javascript
1157
 reload();
1211
 reload();
1159
 
1213
 
1160
 Reloads the current page.
1214
 Reloads the current page.
1161
 
1215
 
1162
-### `stopLoading()`
1216
+### `stopLoading()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1163
 
1217
 
1164
 ```javascript
1218
 ```javascript
1165
 stopLoading();
1219
 stopLoading();
1167
 
1221
 
1168
 Stop loading the current page.
1222
 Stop loading the current page.
1169
 
1223
 
1170
-### `injectJavaScript(str)`
1224
+### `injectJavaScript(str)`[⬆](#methods-index)<!-- Link generated with jump2header -->
1171
 
1225
 
1172
 ```javascript
1226
 ```javascript
1173
 injectJavaScript('... javascript string ...');
1227
 injectJavaScript('... javascript string ...');
1177
 
1231
 
1178
 To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
1232
 To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
1179
 
1233
 
1180
-### `requestFocus()`
1234
+### `requestFocus()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1181
 
1235
 
1182
 ```javascript
1236
 ```javascript
1183
 requestFocus();
1237
 requestFocus();
1185
 
1239
 
1186
 Request the webView to ask for focus. (People working on TV apps might want having a look at this!)
1240
 Request the webView to ask for focus. (People working on TV apps might want having a look at this!)
1187
 
1241
 
1188
-### `clearFormData()`
1242
+### `postMessage(str)`[⬆](#methods-index)<!-- Link generated with jump2header -->
1243
+
1244
+```javascript
1245
+postMessage('message');
1246
+```
1247
+Post a message to WebView, handled by [`onMessage`](Reference.md#onmessage).
1248
+
1249
+### `clearFormData()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1189
 
1250
 
1190
 (android only)
1251
 (android only)
1191
 
1252
 
1195
 
1256
 
1196
 Removes the autocomplete popup from the currently focused form field, if present. [developer.android.com reference](<https://developer.android.com/reference/android/webkit/WebView.html#clearFormData()>)
1257
 Removes the autocomplete popup from the currently focused form field, if present. [developer.android.com reference](<https://developer.android.com/reference/android/webkit/WebView.html#clearFormData()>)
1197
 
1258
 
1198
-### `clearCache(bool)`
1259
+### `clearCache(bool)`[⬆](#methods-index)<!-- Link generated with jump2header -->
1199
 
1260
 
1200
 (android only)
1261
 (android only)
1201
 
1262
 
1205
 
1266
 
1206
 Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used. [developer.android.com reference](<https://developer.android.com/reference/android/webkit/WebView.html#clearCache(boolean)>)
1267
 Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used. [developer.android.com reference](<https://developer.android.com/reference/android/webkit/WebView.html#clearCache(boolean)>)
1207
 
1268
 
1208
-### `clearHistory()`
1269
+### `clearHistory()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1209
 
1270
 
1210
 (android only)
1271
 (android only)
1211
 
1272
 

+ 28
- 0
example/App.tsx Просмотреть файл

13
 import Alerts from './examples/Alerts';
13
 import Alerts from './examples/Alerts';
14
 import Scrolling from './examples/Scrolling';
14
 import Scrolling from './examples/Scrolling';
15
 import Background from './examples/Background';
15
 import Background from './examples/Background';
16
+import Downloads from './examples/Downloads';
16
 import Uploads from './examples/Uploads';
17
 import Uploads from './examples/Uploads';
17
 import Injection from './examples/Injection';
18
 import Injection from './examples/Injection';
19
+import LocalPageLoad from './examples/LocalPageLoad';
18
 
20
 
19
 const TESTS = {
21
 const TESTS = {
20
   Alerts: {
22
   Alerts: {
41
       return <Background />;
43
       return <Background />;
42
     },
44
     },
43
   },
45
   },
46
+  Downloads: {
47
+    title: 'Downloads',
48
+    testId: 'downloads',
49
+    description: 'File downloads test',
50
+    render() {
51
+      return <Downloads />;
52
+    },
53
+  },
44
   Uploads: {
54
   Uploads: {
45
     title: 'Uploads',
55
     title: 'Uploads',
46
     testId: 'uploads',
56
     testId: 'uploads',
57
       return <Injection />;
67
       return <Injection />;
58
     },
68
     },
59
   },
69
   },
70
+  PageLoad: {
71
+    title: 'LocalPageLoad',
72
+    testId: 'LocalPageLoad',
73
+    description: 'Local Page load test',
74
+    render() {
75
+      return <LocalPageLoad />;
76
+    },
77
+  },
60
 };
78
 };
61
 
79
 
62
 type Props = {};
80
 type Props = {};
115
             title="Injection"
133
             title="Injection"
116
             onPress={() => this._changeTest('Injection')}
134
             onPress={() => this._changeTest('Injection')}
117
           />
135
           />
136
+          <Button
137
+            testID="testType_pageLoad"
138
+            title="LocalPageLoad"
139
+            onPress={() => this._changeTest('PageLoad')}
140
+          />
141
+          {Platform.OS == "ios" && <Button
142
+            testID="testType_downloads"
143
+            title="Downloads"
144
+            onPress={() => this._changeTest('Downloads')}
145
+          />}
118
           {Platform.OS === 'android' && <Button
146
           {Platform.OS === 'android' && <Button
119
             testID="testType_uploads"
147
             testID="testType_uploads"
120
             title="Uploads"
148
             title="Uploads"

+ 7
- 0
example/android/app/src/main/java/com/example/MainApplication.java Просмотреть файл

2
 
2
 
3
 import android.app.Application;
3
 import android.app.Application;
4
 import android.content.Context;
4
 import android.content.Context;
5
+import android.os.Build;
6
+import android.webkit.WebView;
7
+
5
 import com.facebook.react.PackageList;
8
 import com.facebook.react.PackageList;
6
 import com.facebook.react.ReactApplication;
9
 import com.facebook.react.ReactApplication;
7
 import com.facebook.react.ReactNativeHost;
10
 import com.facebook.react.ReactNativeHost;
44
   @Override
47
   @Override
45
   public void onCreate() {
48
   public void onCreate() {
46
     super.onCreate();
49
     super.onCreate();
50
+    /* https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews */
51
+    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
52
+      WebView.setWebContentsDebuggingEnabled(true);
53
+    }
47
     SoLoader.init(this, /* native exopackage */ false);
54
     SoLoader.init(this, /* native exopackage */ false);
48
     initializeFlipper(this); // Remove this line if you don't want Flipper enabled
55
     initializeFlipper(this); // Remove this line if you don't want Flipper enabled
49
   }
56
   }

+ 4
- 4
example/android/build.gradle Просмотреть файл

2
 
2
 
3
 buildscript {
3
 buildscript {
4
     ext {
4
     ext {
5
-        buildToolsVersion = "28.0.3"
5
+        buildToolsVersion = "29.0.3"
6
         minSdkVersion = 16
6
         minSdkVersion = 16
7
-        compileSdkVersion = 28
7
+        compileSdkVersion = 29
8
         targetSdkVersion = 28
8
         targetSdkVersion = 28
9
     }
9
     }
10
     repositories {
10
     repositories {
12
         jcenter()
12
         jcenter()
13
     }
13
     }
14
     dependencies {
14
     dependencies {
15
-        classpath("com.android.tools.build:gradle:3.4.2")
15
+        classpath("com.android.tools.build:gradle:3.5.2")
16
 
16
 
17
         // NOTE: Do not place your application dependencies here; they belong
17
         // NOTE: Do not place your application dependencies here; they belong
18
         // in the individual module build.gradle files
18
         // in the individual module build.gradle files
33
 
33
 
34
         google()
34
         google()
35
         jcenter()
35
         jcenter()
36
-        maven { url 'https://jitpack.io' }
36
+        maven { url 'https://www.jitpack.io' }
37
     }
37
     }
38
 }
38
 }

+ 1
- 1
example/android/gradle/wrapper/gradle-wrapper.properties Просмотреть файл

1
 distributionBase=GRADLE_USER_HOME
1
 distributionBase=GRADLE_USER_HOME
2
 distributionPath=wrapper/dists
2
 distributionPath=wrapper/dists
3
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
3
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
4
 zipStoreBase=GRADLE_USER_HOME
4
 zipStoreBase=GRADLE_USER_HOME
5
 zipStorePath=wrapper/dists
5
 zipStorePath=wrapper/dists

+ 2
- 2
example/android/gradlew Просмотреть файл

7
 # you may not use this file except in compliance with the License.
7
 # you may not use this file except in compliance with the License.
8
 # You may obtain a copy of the License at
8
 # You may obtain a copy of the License at
9
 #
9
 #
10
-#      http://www.apache.org/licenses/LICENSE-2.0
10
+#      https://www.apache.org/licenses/LICENSE-2.0
11
 #
11
 #
12
 # Unless required by applicable law or agreed to in writing, software
12
 # Unless required by applicable law or agreed to in writing, software
13
 # distributed under the License is distributed on an "AS IS" BASIS,
13
 # distributed under the License is distributed on an "AS IS" BASIS,
126
 fi
126
 fi
127
 
127
 
128
 # For Cygwin, switch paths to Windows format before running java
128
 # For Cygwin, switch paths to Windows format before running java
129
-if $cygwin ; then
129
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
130
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
131
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132
     JAVACMD=`cygpath --unix "$JAVACMD"`
132
     JAVACMD=`cygpath --unix "$JAVACMD"`

+ 100
- 100
example/android/gradlew.bat Просмотреть файл

1
-@rem
2
-@rem Copyright 2015 the original author or authors.
3
-@rem
4
-@rem Licensed under the Apache License, Version 2.0 (the "License");
5
-@rem you may not use this file except in compliance with the License.
6
-@rem You may obtain a copy of the License at
7
-@rem
8
-@rem      http://www.apache.org/licenses/LICENSE-2.0
9
-@rem
10
-@rem Unless required by applicable law or agreed to in writing, software
11
-@rem distributed under the License is distributed on an "AS IS" BASIS,
12
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
-@rem See the License for the specific language governing permissions and
14
-@rem limitations under the License.
15
-@rem
16
-
17
-@if "%DEBUG%" == "" @echo off
18
-@rem ##########################################################################
19
-@rem
20
-@rem  Gradle startup script for Windows
21
-@rem
22
-@rem ##########################################################################
23
-
24
-@rem Set local scope for the variables with windows NT shell
25
-if "%OS%"=="Windows_NT" setlocal
26
-
27
-set DIRNAME=%~dp0
28
-if "%DIRNAME%" == "" set DIRNAME=.
29
-set APP_BASE_NAME=%~n0
30
-set APP_HOME=%DIRNAME%
31
-
32
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34
-
35
-@rem Find java.exe
36
-if defined JAVA_HOME goto findJavaFromJavaHome
37
-
38
-set JAVA_EXE=java.exe
39
-%JAVA_EXE% -version >NUL 2>&1
40
-if "%ERRORLEVEL%" == "0" goto init
41
-
42
-echo.
43
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44
-echo.
45
-echo Please set the JAVA_HOME variable in your environment to match the
46
-echo location of your Java installation.
47
-
48
-goto fail
49
-
50
-:findJavaFromJavaHome
51
-set JAVA_HOME=%JAVA_HOME:"=%
52
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53
-
54
-if exist "%JAVA_EXE%" goto init
55
-
56
-echo.
57
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58
-echo.
59
-echo Please set the JAVA_HOME variable in your environment to match the
60
-echo location of your Java installation.
61
-
62
-goto fail
63
-
64
-:init
65
-@rem Get command-line arguments, handling Windows variants
66
-
67
-if not "%OS%" == "Windows_NT" goto win9xME_args
68
-
69
-:win9xME_args
70
-@rem Slurp the command line arguments.
71
-set CMD_LINE_ARGS=
72
-set _SKIP=2
73
-
74
-:win9xME_args_slurp
75
-if "x%~1" == "x" goto execute
76
-
77
-set CMD_LINE_ARGS=%*
78
-
79
-:execute
80
-@rem Setup the command line
81
-
82
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83
-
84
-@rem Execute Gradle
85
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86
-
87
-:end
88
-@rem End local scope for the variables with windows NT shell
89
-if "%ERRORLEVEL%"=="0" goto mainEnd
90
-
91
-:fail
92
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93
-rem the _cmd.exe /c_ return code!
94
-if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95
-exit /b 1
96
-
97
-:mainEnd
98
-if "%OS%"=="Windows_NT" endlocal
99
-
100
-:omega
1
+@rem
2
+@rem Copyright 2015 the original author or authors.
3
+@rem
4
+@rem Licensed under the Apache License, Version 2.0 (the "License");
5
+@rem you may not use this file except in compliance with the License.
6
+@rem You may obtain a copy of the License at
7
+@rem
8
+@rem      http://www.apache.org/licenses/LICENSE-2.0
9
+@rem
10
+@rem Unless required by applicable law or agreed to in writing, software
11
+@rem distributed under the License is distributed on an "AS IS" BASIS,
12
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+@rem See the License for the specific language governing permissions and
14
+@rem limitations under the License.
15
+@rem
16
+
17
+@if "%DEBUG%" == "" @echo off
18
+@rem ##########################################################################
19
+@rem
20
+@rem  Gradle startup script for Windows
21
+@rem
22
+@rem ##########################################################################
23
+
24
+@rem Set local scope for the variables with windows NT shell
25
+if "%OS%"=="Windows_NT" setlocal
26
+
27
+set DIRNAME=%~dp0
28
+if "%DIRNAME%" == "" set DIRNAME=.
29
+set APP_BASE_NAME=%~n0
30
+set APP_HOME=%DIRNAME%
31
+
32
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34
+
35
+@rem Find java.exe
36
+if defined JAVA_HOME goto findJavaFromJavaHome
37
+
38
+set JAVA_EXE=java.exe
39
+%JAVA_EXE% -version >NUL 2>&1
40
+if "%ERRORLEVEL%" == "0" goto init
41
+
42
+echo.
43
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44
+echo.
45
+echo Please set the JAVA_HOME variable in your environment to match the
46
+echo location of your Java installation.
47
+
48
+goto fail
49
+
50
+:findJavaFromJavaHome
51
+set JAVA_HOME=%JAVA_HOME:"=%
52
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53
+
54
+if exist "%JAVA_EXE%" goto init
55
+
56
+echo.
57
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58
+echo.
59
+echo Please set the JAVA_HOME variable in your environment to match the
60
+echo location of your Java installation.
61
+
62
+goto fail
63
+
64
+:init
65
+@rem Get command-line arguments, handling Windows variants
66
+
67
+if not "%OS%" == "Windows_NT" goto win9xME_args
68
+
69
+:win9xME_args
70
+@rem Slurp the command line arguments.
71
+set CMD_LINE_ARGS=
72
+set _SKIP=2
73
+
74
+:win9xME_args_slurp
75
+if "x%~1" == "x" goto execute
76
+
77
+set CMD_LINE_ARGS=%*
78
+
79
+:execute
80
+@rem Setup the command line
81
+
82
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83
+
84
+@rem Execute Gradle
85
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86
+
87
+:end
88
+@rem End local scope for the variables with windows NT shell
89
+if "%ERRORLEVEL%"=="0" goto mainEnd
90
+
91
+:fail
92
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93
+rem the _cmd.exe /c_ return code!
94
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95
+exit /b 1
96
+
97
+:mainEnd
98
+if "%OS%"=="Windows_NT" endlocal
99
+
100
+:omega

+ 9
- 0
example/assets/test.html Просмотреть файл

1
+<!doctype html>
2
+<html>
3
+    <head>
4
+        <title>Test</title>
5
+    </head>
6
+    <body>
7
+        <h2>Local page test</h2>
8
+    </body>
9
+</html>

+ 55
- 0
example/examples/Downloads.tsx Просмотреть файл

1
+import React, {Component} from 'react';
2
+import {Alert, Platform, View} from 'react-native';
3
+
4
+import WebView, {FileDownload} from 'react-native-webview';
5
+
6
+const HTML = `
7
+<!DOCTYPE html>\n
8
+<html>
9
+  <head>
10
+    <title>Downloads</title>
11
+    <meta http-equiv="content-type" content="text/html; charset=utf-8">
12
+    <meta name="viewport" content="width=320, user-scalable=no">
13
+    <style type="text/css">
14
+      body {
15
+        margin: 0;
16
+        padding: 0;
17
+        font: 62.5% arial, sans-serif;
18
+        background: #ccc;
19
+      }
20
+    </style>
21
+  </head>
22
+  <body>
23
+    <a href="https://www.7-zip.org/a/7za920.zip">Example zip file download</a>
24
+  </body>
25
+</html>
26
+`;
27
+
28
+type Props = {};
29
+type State = {};
30
+
31
+export default class Downloads extends Component<Props, State> {
32
+  state = {};
33
+
34
+  onFileDownload = ({ nativeEvent }: { nativeEvent: FileDownload } ) => {
35
+    Alert.alert("File download detected", nativeEvent.downloadUrl);
36
+  };
37
+
38
+  render() {
39
+    const platformProps = Platform.select({
40
+      ios: {
41
+        onFileDownload: this.onFileDownload,
42
+      },
43
+    });
44
+
45
+    return (
46
+      <View style={{ height: 120 }}>
47
+        <WebView
48
+          source={{html: HTML}}
49
+          automaticallyAdjustContentInsets={false}
50
+          {...platformProps}
51
+        />
52
+      </View>
53
+    );
54
+  }
55
+}

+ 28
- 27
example/examples/Injection.tsx Просмотреть файл

3
 
3
 
4
 import WebView from 'react-native-webview';
4
 import WebView from 'react-native-webview';
5
 
5
 
6
-// const HTML = `
7
-// <!DOCTYPE html>
8
-// <html>
9
-//   <head>
10
-//       <meta charset="utf-8">
11
-//       <meta name="viewport" content="width=device-width, initial-scale=1">
12
-//       <title>iframe test</title>
13
-//   </head>
14
-//   <body>
15
-//     <p style="">beforeContentLoaded on the top frame <span id="before_failed" style="display: inline-block;">failed</span><span id="before_succeeded" style="display: none;">succeeded</span>!</p>
16
-//     <p style="">afterContentLoaded on the top frame <span id="after_failed" style="display: inline-block;">failed</span><span id="after_succeeded" style="display: none;">succeeded</span>!</p>
17
-//     <iframe src="https://birchlabs.co.uk/linguabrowse/infopages/obsol/iframe.html?v=1" name="iframe_0" style="width: 100%; height: 25px;"></iframe>
18
-//     <iframe src="https://birchlabs.co.uk/linguabrowse/infopages/obsol/iframe2.html?v=1" name="iframe_1" style="width: 100%; height: 25px;"></iframe>
19
-//     <iframe src="https://www.ebay.co.uk" name="iframe_2" style="width: 100%; height: 25px;"></iframe>
20
-//   </body>
21
-// </html>
22
-// `;
6
+const HTML = `
7
+<!DOCTYPE html>
8
+<html>
9
+  <head>
10
+      <meta charset="utf-8">
11
+      <meta name="viewport" content="width=device-width, initial-scale=1">
12
+      <title>iframe test</title>
13
+  </head>
14
+  <body>
15
+    <p style="">beforeContentLoaded on the top frame <span id="before_failed" style="display: inline-block;">failed</span><span id="before_succeeded" style="display: none;">succeeded</span>!</p>
16
+    <p style="">afterContentLoaded on the top frame <span id="after_failed" style="display: inline-block;">failed</span><span id="after_succeeded" style="display: none;">succeeded</span>!</p>
17
+    <iframe src="https://birchlabs.co.uk/linguabrowse/infopages/obsol/iframe.html?v=1" name="iframe_0" style="width: 100%; height: 25px;"></iframe>
18
+    <iframe src="https://birchlabs.co.uk/linguabrowse/infopages/obsol/iframe2.html?v=1" name="iframe_1" style="width: 100%; height: 25px;"></iframe>
19
+    <iframe src="https://www.ebay.co.uk" name="iframe_2" style="width: 100%; height: 25px;"></iframe>
20
+  </body>
21
+</html>
22
+`;
23
 
23
 
24
 type Props = {};
24
 type Props = {};
25
 type State = {
25
 type State = {
35
     return (
35
     return (
36
       <ScrollView>
36
       <ScrollView>
37
         <View style={{ }}>
37
         <View style={{ }}>
38
-          <View style={{ height: 300 }}>
38
+          <View style={{ height: 400 }}>
39
             <WebView
39
             <WebView
40
               /**
40
               /**
41
-               * This HTML is a copy of a multi-frame JS injection test that I had lying around.
42
-               * @see https://birchlabs.co.uk/linguabrowse/infopages/obsol/iframeTest.html
41
+               * This HTML is a copy of the hosted multi-frame JS injection test.
42
+               * I have found that Android doesn't support beforeContentLoaded for a hosted HTML webpage, yet does for a static source.
43
+               * The cause of this is unresolved.
43
                */
44
                */
44
               // source={{ html: HTML }}
45
               // source={{ html: HTML }}
45
               source={{ uri: "https://birchlabs.co.uk/linguabrowse/infopages/obsol/rnw_iframe_test.html" }}
46
               source={{ uri: "https://birchlabs.co.uk/linguabrowse/infopages/obsol/rnw_iframe_test.html" }}
50
                * JS injection user scripts, consistent with current behaviour. This is undesirable,
51
                * JS injection user scripts, consistent with current behaviour. This is undesirable,
51
                * so needs addressing in a follow-up PR. */
52
                * so needs addressing in a follow-up PR. */
52
               onMessage={() => {}}
53
               onMessage={() => {}}
54
+              injectedJavaScriptBeforeContentLoadedForMainFrameOnly={false}
55
+              injectedJavaScriptForMainFrameOnly={false}
53
 
56
 
54
               /* We set this property in each frame */
57
               /* We set this property in each frame */
55
               injectedJavaScriptBeforeContentLoaded={`
58
               injectedJavaScriptBeforeContentLoaded={`
56
-              console.log("executing injectedJavaScriptBeforeContentLoaded...");
59
+              console.log("executing injectedJavaScriptBeforeContentLoaded... " + (new Date()).toString());
57
               if(typeof window.top.injectedIframesBeforeContentLoaded === "undefined"){
60
               if(typeof window.top.injectedIframesBeforeContentLoaded === "undefined"){
58
                 window.top.injectedIframesBeforeContentLoaded = [];
61
                 window.top.injectedIframesBeforeContentLoaded = [];
59
               }
62
               }
84
                 console.log("wasn't window.top. Still going...");
87
                 console.log("wasn't window.top. Still going...");
85
               }
88
               }
86
               `}
89
               `}
87
-              
88
-              injectedJavaScriptForMainFrameOnly={false}
89
 
90
 
90
               /* We read the colourToUse property in each frame to recolour each frame */
91
               /* We read the colourToUse property in each frame to recolour each frame */
91
               injectedJavaScript={`
92
               injectedJavaScript={`
92
-              console.log("executing injectedJavaScript...");
93
+              console.log("executing injectedJavaScript... " + (new Date()).toString());
93
               if(typeof window.top.injectedIframesAfterContentLoaded === "undefined"){
94
               if(typeof window.top.injectedIframesAfterContentLoaded === "undefined"){
94
                 window.top.injectedIframesAfterContentLoaded = [];
95
                 window.top.injectedIframesAfterContentLoaded = [];
95
               }
96
               }
119
                 // numberOfFramesAtAfterContentLoadedEle.id = "numberOfFramesAtAfterContentLoadedEle";
120
                 // numberOfFramesAtAfterContentLoadedEle.id = "numberOfFramesAtAfterContentLoadedEle";
120
 
121
 
121
                 var namedFramesAtBeforeContentLoadedEle = document.createElement('p');
122
                 var namedFramesAtBeforeContentLoadedEle = document.createElement('p');
122
-                namedFramesAtBeforeContentLoadedEle.textContent = "Names of iframes that called beforeContentLoaded: " + JSON.stringify(window.top.injectedIframesBeforeContentLoaded);
123
+                namedFramesAtBeforeContentLoadedEle.textContent = "Names of iframes that called beforeContentLoaded: " + JSON.stringify(window.top.injectedIframesBeforeContentLoaded || []);
123
                 namedFramesAtBeforeContentLoadedEle.id = "namedFramesAtBeforeContentLoadedEle";
124
                 namedFramesAtBeforeContentLoadedEle.id = "namedFramesAtBeforeContentLoadedEle";
124
 
125
 
125
                 var namedFramesAtAfterContentLoadedEle = document.createElement('p');
126
                 var namedFramesAtAfterContentLoadedEle = document.createElement('p');
147
         <Text>✅ If the main frame becomes orange, then top-frame injection both beforeContentLoaded and afterContentLoaded is supported.</Text>
148
         <Text>✅ If the main frame becomes orange, then top-frame injection both beforeContentLoaded and afterContentLoaded is supported.</Text>
148
         <Text>✅ If iframe_0, and iframe_1 become orange, then multi-frame injection beforeContentLoaded and afterContentLoaded is supported.</Text>
149
         <Text>✅ If iframe_0, and iframe_1 become orange, then multi-frame injection beforeContentLoaded and afterContentLoaded is supported.</Text>
149
         <Text>✅ If the two texts say "beforeContentLoaded on the top frame succeeded!" and "afterContentLoaded on the top frame succeeded!", then both injection times are supported at least on the main frame.</Text>
150
         <Text>✅ If the two texts say "beforeContentLoaded on the top frame succeeded!" and "afterContentLoaded on the top frame succeeded!", then both injection times are supported at least on the main frame.</Text>
150
-        <Text>⚠️ If either of the two iframes become coloured cyan, then for that given frame, JS injection succeeded after the content loaded, but didn't occur before the content loaded - please note that for iframes, this may not be a test failure, as it is not clear whether we would expect iframes to support an injection time of beforeContentLoaded anyway.</Text>
151
-        <Text>⚠️ If "Names of iframes that called beforeContentLoaded: " is [], then see above.</Text>
151
+        <Text> If either of the two iframes become coloured cyan, then for that given frame, JS injection succeeded after the content loaded, but didn't occur before the content loaded.</Text>
152
+        <Text> If "Names of iframes that called beforeContentLoaded: " is [], then see above.</Text>
152
         <Text>❌ If "Names of iframes that called afterContentLoaded: " is [], then afterContentLoaded is not supported in iframes.</Text>
153
         <Text>❌ If "Names of iframes that called afterContentLoaded: " is [], then afterContentLoaded is not supported in iframes.</Text>
153
         <Text>❌ If the main frame becomes coloured cyan, then JS injection succeeded after the content loaded, but didn't occur before the content loaded.</Text>
154
         <Text>❌ If the main frame becomes coloured cyan, then JS injection succeeded after the content loaded, but didn't occur before the content loaded.</Text>
154
         <Text>❌ If the text "beforeContentLoaded on the top frame failed" remains unchanged, then JS injection has failed on the main frame before the content loaded.</Text>
155
         <Text>❌ If the text "beforeContentLoaded on the top frame failed" remains unchanged, then JS injection has failed on the main frame before the content loaded.</Text>

+ 16
- 0
example/examples/LocalPageLoad.tsx Просмотреть файл

1
+import React, {Component} from 'react';
2
+import {View, Text, Alert, TextInput, Button} from 'react-native';
3
+import WebView from 'react-native-webview';
4
+const localHtmlFile = require('../assets/test.html');
5
+
6
+export default class LocalPageLoad extends Component<Props, State> {
7
+    render() {
8
+      return (
9
+        <View>
10
+            <View style={{ width: '100%', height: '100%' }}>
11
+                <WebView source={localHtmlFile}/>
12
+          </View>
13
+        </View>
14
+      );
15
+    }
16
+  }

+ 6
- 6
example/ios/Podfile Просмотреть файл

4
 project './example.xcodeproj'
4
 project './example.xcodeproj'
5
 
5
 
6
 target 'example' do
6
 target 'example' do
7
-  # Pods for example
7
+  use_native_modules!
8
+
8
   pod 'react-native-webview', :path => "../.."
9
   pod 'react-native-webview', :path => "../.."
10
+
9
   pod 'FBLazyVector', :path => "../../node_modules/react-native/Libraries/FBLazyVector"
11
   pod 'FBLazyVector', :path => "../../node_modules/react-native/Libraries/FBLazyVector"
10
   pod 'FBReactNativeSpec', :path => "../../node_modules/react-native/Libraries/FBReactNativeSpec"
12
   pod 'FBReactNativeSpec', :path => "../../node_modules/react-native/Libraries/FBReactNativeSpec"
11
   pod 'RCTRequired', :path => "../../node_modules/react-native/Libraries/RCTRequired"
13
   pod 'RCTRequired', :path => "../../node_modules/react-native/Libraries/RCTRequired"
29
   pod 'React-jsi', :path => '../../node_modules/react-native/ReactCommon/jsi'
31
   pod 'React-jsi', :path => '../../node_modules/react-native/ReactCommon/jsi'
30
   pod 'React-jsiexecutor', :path => '../../node_modules/react-native/ReactCommon/jsiexecutor'
32
   pod 'React-jsiexecutor', :path => '../../node_modules/react-native/ReactCommon/jsiexecutor'
31
   pod 'React-jsinspector', :path => '../../node_modules/react-native/ReactCommon/jsinspector'
33
   pod 'React-jsinspector', :path => '../../node_modules/react-native/ReactCommon/jsinspector'
32
-  pod 'ReactCommon/jscallinvoker', :path => "../../node_modules/react-native/ReactCommon"
34
+  pod 'ReactCommon/callinvoker', :path => "../../node_modules/react-native/ReactCommon"
33
   pod 'ReactCommon/turbomodule/core', :path => "../../node_modules/react-native/ReactCommon"
35
   pod 'ReactCommon/turbomodule/core', :path => "../../node_modules/react-native/ReactCommon"
34
-  pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'
36
+  pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
35
 
37
 
36
   pod 'DoubleConversion', :podspec => '../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
38
   pod 'DoubleConversion', :podspec => '../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
37
   pod 'glog', :podspec => '../../node_modules/react-native/third-party-podspecs/glog.podspec'
39
   pod 'glog', :podspec => '../../node_modules/react-native/third-party-podspecs/glog.podspec'
41
     inherit! :search_paths
43
     inherit! :search_paths
42
     # Pods for testing
44
     # Pods for testing
43
   end
45
   end
44
-
45
-  use_native_modules!
46
 end
46
 end
47
 
47
 
48
 target 'example-tvOS' do
48
 target 'example-tvOS' do
49
   # Pods for example-tvOS
49
   # Pods for example-tvOS
50
 
50
 
51
   target 'example-tvOSTests' do
51
   target 'example-tvOSTests' do
52
-    inherit! :search_paths
52
+    inherit! :complete
53
     # Pods for testing
53
     # Pods for testing
54
   end
54
   end
55
 
55
 

+ 181
- 157
example/ios/Podfile.lock Просмотреть файл

1
 PODS:
1
 PODS:
2
   - boost-for-react-native (1.63.0)
2
   - boost-for-react-native (1.63.0)
3
   - DoubleConversion (1.1.6)
3
   - DoubleConversion (1.1.6)
4
-  - FBLazyVector (0.61.5)
5
-  - FBReactNativeSpec (0.61.5):
4
+  - FBLazyVector (0.62.2)
5
+  - FBReactNativeSpec (0.62.2):
6
     - Folly (= 2018.10.22.00)
6
     - Folly (= 2018.10.22.00)
7
-    - RCTRequired (= 0.61.5)
8
-    - RCTTypeSafety (= 0.61.5)
9
-    - React-Core (= 0.61.5)
10
-    - React-jsi (= 0.61.5)
11
-    - ReactCommon/turbomodule/core (= 0.61.5)
7
+    - RCTRequired (= 0.62.2)
8
+    - RCTTypeSafety (= 0.62.2)
9
+    - React-Core (= 0.62.2)
10
+    - React-jsi (= 0.62.2)
11
+    - ReactCommon/turbomodule/core (= 0.62.2)
12
   - Folly (2018.10.22.00):
12
   - Folly (2018.10.22.00):
13
     - boost-for-react-native
13
     - boost-for-react-native
14
     - DoubleConversion
14
     - DoubleConversion
19
     - DoubleConversion
19
     - DoubleConversion
20
     - glog
20
     - glog
21
   - glog (0.3.5)
21
   - glog (0.3.5)
22
-  - RCTRequired (0.61.5)
23
-  - RCTTypeSafety (0.61.5):
24
-    - FBLazyVector (= 0.61.5)
22
+  - RCTRequired (0.62.2)
23
+  - RCTTypeSafety (0.62.2):
24
+    - FBLazyVector (= 0.62.2)
25
     - Folly (= 2018.10.22.00)
25
     - Folly (= 2018.10.22.00)
26
-    - RCTRequired (= 0.61.5)
27
-    - React-Core (= 0.61.5)
28
-  - React (0.61.5):
29
-    - React-Core (= 0.61.5)
30
-    - React-Core/DevSupport (= 0.61.5)
31
-    - React-Core/RCTWebSocket (= 0.61.5)
32
-    - React-RCTActionSheet (= 0.61.5)
33
-    - React-RCTAnimation (= 0.61.5)
34
-    - React-RCTBlob (= 0.61.5)
35
-    - React-RCTImage (= 0.61.5)
36
-    - React-RCTLinking (= 0.61.5)
37
-    - React-RCTNetwork (= 0.61.5)
38
-    - React-RCTSettings (= 0.61.5)
39
-    - React-RCTText (= 0.61.5)
40
-    - React-RCTVibration (= 0.61.5)
41
-  - React-Core (0.61.5):
26
+    - RCTRequired (= 0.62.2)
27
+    - React-Core (= 0.62.2)
28
+  - React (0.62.2):
29
+    - React-Core (= 0.62.2)
30
+    - React-Core/DevSupport (= 0.62.2)
31
+    - React-Core/RCTWebSocket (= 0.62.2)
32
+    - React-RCTActionSheet (= 0.62.2)
33
+    - React-RCTAnimation (= 0.62.2)
34
+    - React-RCTBlob (= 0.62.2)
35
+    - React-RCTImage (= 0.62.2)
36
+    - React-RCTLinking (= 0.62.2)
37
+    - React-RCTNetwork (= 0.62.2)
38
+    - React-RCTSettings (= 0.62.2)
39
+    - React-RCTText (= 0.62.2)
40
+    - React-RCTVibration (= 0.62.2)
41
+  - React-Core (0.62.2):
42
     - Folly (= 2018.10.22.00)
42
     - Folly (= 2018.10.22.00)
43
     - glog
43
     - glog
44
-    - React-Core/Default (= 0.61.5)
45
-    - React-cxxreact (= 0.61.5)
46
-    - React-jsi (= 0.61.5)
47
-    - React-jsiexecutor (= 0.61.5)
44
+    - React-Core/Default (= 0.62.2)
45
+    - React-cxxreact (= 0.62.2)
46
+    - React-jsi (= 0.62.2)
47
+    - React-jsiexecutor (= 0.62.2)
48
     - Yoga
48
     - Yoga
49
-  - React-Core/CoreModulesHeaders (0.61.5):
49
+  - React-Core/CoreModulesHeaders (0.62.2):
50
     - Folly (= 2018.10.22.00)
50
     - Folly (= 2018.10.22.00)
51
     - glog
51
     - glog
52
     - React-Core/Default
52
     - React-Core/Default
53
-    - React-cxxreact (= 0.61.5)
54
-    - React-jsi (= 0.61.5)
55
-    - React-jsiexecutor (= 0.61.5)
53
+    - React-cxxreact (= 0.62.2)
54
+    - React-jsi (= 0.62.2)
55
+    - React-jsiexecutor (= 0.62.2)
56
     - Yoga
56
     - Yoga
57
-  - React-Core/Default (0.61.5):
57
+  - React-Core/Default (0.62.2):
58
     - Folly (= 2018.10.22.00)
58
     - Folly (= 2018.10.22.00)
59
     - glog
59
     - glog
60
-    - React-cxxreact (= 0.61.5)
61
-    - React-jsi (= 0.61.5)
62
-    - React-jsiexecutor (= 0.61.5)
60
+    - React-cxxreact (= 0.62.2)
61
+    - React-jsi (= 0.62.2)
62
+    - React-jsiexecutor (= 0.62.2)
63
     - Yoga
63
     - Yoga
64
-  - React-Core/DevSupport (0.61.5):
64
+  - React-Core/DevSupport (0.62.2):
65
     - Folly (= 2018.10.22.00)
65
     - Folly (= 2018.10.22.00)
66
     - glog
66
     - glog
67
-    - React-Core/Default (= 0.61.5)
68
-    - React-Core/RCTWebSocket (= 0.61.5)
69
-    - React-cxxreact (= 0.61.5)
70
-    - React-jsi (= 0.61.5)
71
-    - React-jsiexecutor (= 0.61.5)
72
-    - React-jsinspector (= 0.61.5)
67
+    - React-Core/Default (= 0.62.2)
68
+    - React-Core/RCTWebSocket (= 0.62.2)
69
+    - React-cxxreact (= 0.62.2)
70
+    - React-jsi (= 0.62.2)
71
+    - React-jsiexecutor (= 0.62.2)
72
+    - React-jsinspector (= 0.62.2)
73
     - Yoga
73
     - Yoga
74
-  - React-Core/RCTActionSheetHeaders (0.61.5):
74
+  - React-Core/RCTActionSheetHeaders (0.62.2):
75
     - Folly (= 2018.10.22.00)
75
     - Folly (= 2018.10.22.00)
76
     - glog
76
     - glog
77
     - React-Core/Default
77
     - React-Core/Default
78
-    - React-cxxreact (= 0.61.5)
79
-    - React-jsi (= 0.61.5)
80
-    - React-jsiexecutor (= 0.61.5)
78
+    - React-cxxreact (= 0.62.2)
79
+    - React-jsi (= 0.62.2)
80
+    - React-jsiexecutor (= 0.62.2)
81
     - Yoga
81
     - Yoga
82
-  - React-Core/RCTAnimationHeaders (0.61.5):
82
+  - React-Core/RCTAnimationHeaders (0.62.2):
83
     - Folly (= 2018.10.22.00)
83
     - Folly (= 2018.10.22.00)
84
     - glog
84
     - glog
85
     - React-Core/Default
85
     - React-Core/Default
86
-    - React-cxxreact (= 0.61.5)
87
-    - React-jsi (= 0.61.5)
88
-    - React-jsiexecutor (= 0.61.5)
86
+    - React-cxxreact (= 0.62.2)
87
+    - React-jsi (= 0.62.2)
88
+    - React-jsiexecutor (= 0.62.2)
89
     - Yoga
89
     - Yoga
90
-  - React-Core/RCTBlobHeaders (0.61.5):
90
+  - React-Core/RCTBlobHeaders (0.62.2):
91
     - Folly (= 2018.10.22.00)
91
     - Folly (= 2018.10.22.00)
92
     - glog
92
     - glog
93
     - React-Core/Default
93
     - React-Core/Default
94
-    - React-cxxreact (= 0.61.5)
95
-    - React-jsi (= 0.61.5)
96
-    - React-jsiexecutor (= 0.61.5)
94
+    - React-cxxreact (= 0.62.2)
95
+    - React-jsi (= 0.62.2)
96
+    - React-jsiexecutor (= 0.62.2)
97
     - Yoga
97
     - Yoga
98
-  - React-Core/RCTImageHeaders (0.61.5):
98
+  - React-Core/RCTImageHeaders (0.62.2):
99
     - Folly (= 2018.10.22.00)
99
     - Folly (= 2018.10.22.00)
100
     - glog
100
     - glog
101
     - React-Core/Default
101
     - React-Core/Default
102
-    - React-cxxreact (= 0.61.5)
103
-    - React-jsi (= 0.61.5)
104
-    - React-jsiexecutor (= 0.61.5)
102
+    - React-cxxreact (= 0.62.2)
103
+    - React-jsi (= 0.62.2)
104
+    - React-jsiexecutor (= 0.62.2)
105
     - Yoga
105
     - Yoga
106
-  - React-Core/RCTLinkingHeaders (0.61.5):
106
+  - React-Core/RCTLinkingHeaders (0.62.2):
107
     - Folly (= 2018.10.22.00)
107
     - Folly (= 2018.10.22.00)
108
     - glog
108
     - glog
109
     - React-Core/Default
109
     - React-Core/Default
110
-    - React-cxxreact (= 0.61.5)
111
-    - React-jsi (= 0.61.5)
112
-    - React-jsiexecutor (= 0.61.5)
110
+    - React-cxxreact (= 0.62.2)
111
+    - React-jsi (= 0.62.2)
112
+    - React-jsiexecutor (= 0.62.2)
113
     - Yoga
113
     - Yoga
114
-  - React-Core/RCTNetworkHeaders (0.61.5):
114
+  - React-Core/RCTNetworkHeaders (0.62.2):
115
     - Folly (= 2018.10.22.00)
115
     - Folly (= 2018.10.22.00)
116
     - glog
116
     - glog
117
     - React-Core/Default
117
     - React-Core/Default
118
-    - React-cxxreact (= 0.61.5)
119
-    - React-jsi (= 0.61.5)
120
-    - React-jsiexecutor (= 0.61.5)
118
+    - React-cxxreact (= 0.62.2)
119
+    - React-jsi (= 0.62.2)
120
+    - React-jsiexecutor (= 0.62.2)
121
     - Yoga
121
     - Yoga
122
-  - React-Core/RCTSettingsHeaders (0.61.5):
122
+  - React-Core/RCTSettingsHeaders (0.62.2):
123
     - Folly (= 2018.10.22.00)
123
     - Folly (= 2018.10.22.00)
124
     - glog
124
     - glog
125
     - React-Core/Default
125
     - React-Core/Default
126
-    - React-cxxreact (= 0.61.5)
127
-    - React-jsi (= 0.61.5)
128
-    - React-jsiexecutor (= 0.61.5)
126
+    - React-cxxreact (= 0.62.2)
127
+    - React-jsi (= 0.62.2)
128
+    - React-jsiexecutor (= 0.62.2)
129
     - Yoga
129
     - Yoga
130
-  - React-Core/RCTTextHeaders (0.61.5):
130
+  - React-Core/RCTTextHeaders (0.62.2):
131
     - Folly (= 2018.10.22.00)
131
     - Folly (= 2018.10.22.00)
132
     - glog
132
     - glog
133
     - React-Core/Default
133
     - React-Core/Default
134
-    - React-cxxreact (= 0.61.5)
135
-    - React-jsi (= 0.61.5)
136
-    - React-jsiexecutor (= 0.61.5)
134
+    - React-cxxreact (= 0.62.2)
135
+    - React-jsi (= 0.62.2)
136
+    - React-jsiexecutor (= 0.62.2)
137
     - Yoga
137
     - Yoga
138
-  - React-Core/RCTVibrationHeaders (0.61.5):
138
+  - React-Core/RCTVibrationHeaders (0.62.2):
139
     - Folly (= 2018.10.22.00)
139
     - Folly (= 2018.10.22.00)
140
     - glog
140
     - glog
141
     - React-Core/Default
141
     - React-Core/Default
142
-    - React-cxxreact (= 0.61.5)
143
-    - React-jsi (= 0.61.5)
144
-    - React-jsiexecutor (= 0.61.5)
142
+    - React-cxxreact (= 0.62.2)
143
+    - React-jsi (= 0.62.2)
144
+    - React-jsiexecutor (= 0.62.2)
145
     - Yoga
145
     - Yoga
146
-  - React-Core/RCTWebSocket (0.61.5):
146
+  - React-Core/RCTWebSocket (0.62.2):
147
     - Folly (= 2018.10.22.00)
147
     - Folly (= 2018.10.22.00)
148
     - glog
148
     - glog
149
-    - React-Core/Default (= 0.61.5)
150
-    - React-cxxreact (= 0.61.5)
151
-    - React-jsi (= 0.61.5)
152
-    - React-jsiexecutor (= 0.61.5)
149
+    - React-Core/Default (= 0.62.2)
150
+    - React-cxxreact (= 0.62.2)
151
+    - React-jsi (= 0.62.2)
152
+    - React-jsiexecutor (= 0.62.2)
153
     - Yoga
153
     - Yoga
154
-  - React-CoreModules (0.61.5):
155
-    - FBReactNativeSpec (= 0.61.5)
154
+  - React-CoreModules (0.62.2):
155
+    - FBReactNativeSpec (= 0.62.2)
156
     - Folly (= 2018.10.22.00)
156
     - Folly (= 2018.10.22.00)
157
-    - RCTTypeSafety (= 0.61.5)
158
-    - React-Core/CoreModulesHeaders (= 0.61.5)
159
-    - React-RCTImage (= 0.61.5)
160
-    - ReactCommon/turbomodule/core (= 0.61.5)
161
-  - React-cxxreact (0.61.5):
157
+    - RCTTypeSafety (= 0.62.2)
158
+    - React-Core/CoreModulesHeaders (= 0.62.2)
159
+    - React-RCTImage (= 0.62.2)
160
+    - ReactCommon/turbomodule/core (= 0.62.2)
161
+  - React-cxxreact (0.62.2):
162
     - boost-for-react-native (= 1.63.0)
162
     - boost-for-react-native (= 1.63.0)
163
     - DoubleConversion
163
     - DoubleConversion
164
     - Folly (= 2018.10.22.00)
164
     - Folly (= 2018.10.22.00)
165
     - glog
165
     - glog
166
-    - React-jsinspector (= 0.61.5)
167
-  - React-jsi (0.61.5):
166
+    - React-jsinspector (= 0.62.2)
167
+  - React-jsi (0.62.2):
168
     - boost-for-react-native (= 1.63.0)
168
     - boost-for-react-native (= 1.63.0)
169
     - DoubleConversion
169
     - DoubleConversion
170
     - Folly (= 2018.10.22.00)
170
     - Folly (= 2018.10.22.00)
171
     - glog
171
     - glog
172
-    - React-jsi/Default (= 0.61.5)
173
-  - React-jsi/Default (0.61.5):
172
+    - React-jsi/Default (= 0.62.2)
173
+  - React-jsi/Default (0.62.2):
174
     - boost-for-react-native (= 1.63.0)
174
     - boost-for-react-native (= 1.63.0)
175
     - DoubleConversion
175
     - DoubleConversion
176
     - Folly (= 2018.10.22.00)
176
     - Folly (= 2018.10.22.00)
177
     - glog
177
     - glog
178
-  - React-jsiexecutor (0.61.5):
178
+  - React-jsiexecutor (0.62.2):
179
     - DoubleConversion
179
     - DoubleConversion
180
     - Folly (= 2018.10.22.00)
180
     - Folly (= 2018.10.22.00)
181
     - glog
181
     - glog
182
-    - React-cxxreact (= 0.61.5)
183
-    - React-jsi (= 0.61.5)
184
-  - React-jsinspector (0.61.5)
185
-  - react-native-webview (8.2.0):
182
+    - React-cxxreact (= 0.62.2)
183
+    - React-jsi (= 0.62.2)
184
+  - React-jsinspector (0.62.2)
185
+  - react-native-webview (9.4.0):
186
     - React
186
     - React
187
-  - React-RCTActionSheet (0.61.5):
188
-    - React-Core/RCTActionSheetHeaders (= 0.61.5)
189
-  - React-RCTAnimation (0.61.5):
190
-    - React-Core/RCTAnimationHeaders (= 0.61.5)
191
-  - React-RCTBlob (0.61.5):
192
-    - React-Core/RCTBlobHeaders (= 0.61.5)
193
-    - React-Core/RCTWebSocket (= 0.61.5)
194
-    - React-jsi (= 0.61.5)
195
-    - React-RCTNetwork (= 0.61.5)
196
-  - React-RCTImage (0.61.5):
197
-    - React-Core/RCTImageHeaders (= 0.61.5)
198
-    - React-RCTNetwork (= 0.61.5)
199
-  - React-RCTLinking (0.61.5):
200
-    - React-Core/RCTLinkingHeaders (= 0.61.5)
201
-  - React-RCTNetwork (0.61.5):
202
-    - React-Core/RCTNetworkHeaders (= 0.61.5)
203
-  - React-RCTSettings (0.61.5):
204
-    - React-Core/RCTSettingsHeaders (= 0.61.5)
205
-  - React-RCTText (0.61.5):
206
-    - React-Core/RCTTextHeaders (= 0.61.5)
207
-  - React-RCTVibration (0.61.5):
208
-    - React-Core/RCTVibrationHeaders (= 0.61.5)
209
-  - ReactCommon/jscallinvoker (0.61.5):
187
+  - React-RCTActionSheet (0.62.2):
188
+    - React-Core/RCTActionSheetHeaders (= 0.62.2)
189
+  - React-RCTAnimation (0.62.2):
190
+    - FBReactNativeSpec (= 0.62.2)
191
+    - Folly (= 2018.10.22.00)
192
+    - RCTTypeSafety (= 0.62.2)
193
+    - React-Core/RCTAnimationHeaders (= 0.62.2)
194
+    - ReactCommon/turbomodule/core (= 0.62.2)
195
+  - React-RCTBlob (0.62.2):
196
+    - FBReactNativeSpec (= 0.62.2)
197
+    - Folly (= 2018.10.22.00)
198
+    - React-Core/RCTBlobHeaders (= 0.62.2)
199
+    - React-Core/RCTWebSocket (= 0.62.2)
200
+    - React-jsi (= 0.62.2)
201
+    - React-RCTNetwork (= 0.62.2)
202
+    - ReactCommon/turbomodule/core (= 0.62.2)
203
+  - React-RCTImage (0.62.2):
204
+    - FBReactNativeSpec (= 0.62.2)
205
+    - Folly (= 2018.10.22.00)
206
+    - RCTTypeSafety (= 0.62.2)
207
+    - React-Core/RCTImageHeaders (= 0.62.2)
208
+    - React-RCTNetwork (= 0.62.2)
209
+    - ReactCommon/turbomodule/core (= 0.62.2)
210
+  - React-RCTLinking (0.62.2):
211
+    - FBReactNativeSpec (= 0.62.2)
212
+    - React-Core/RCTLinkingHeaders (= 0.62.2)
213
+    - ReactCommon/turbomodule/core (= 0.62.2)
214
+  - React-RCTNetwork (0.62.2):
215
+    - FBReactNativeSpec (= 0.62.2)
216
+    - Folly (= 2018.10.22.00)
217
+    - RCTTypeSafety (= 0.62.2)
218
+    - React-Core/RCTNetworkHeaders (= 0.62.2)
219
+    - ReactCommon/turbomodule/core (= 0.62.2)
220
+  - React-RCTSettings (0.62.2):
221
+    - FBReactNativeSpec (= 0.62.2)
222
+    - Folly (= 2018.10.22.00)
223
+    - RCTTypeSafety (= 0.62.2)
224
+    - React-Core/RCTSettingsHeaders (= 0.62.2)
225
+    - ReactCommon/turbomodule/core (= 0.62.2)
226
+  - React-RCTText (0.62.2):
227
+    - React-Core/RCTTextHeaders (= 0.62.2)
228
+  - React-RCTVibration (0.62.2):
229
+    - FBReactNativeSpec (= 0.62.2)
230
+    - Folly (= 2018.10.22.00)
231
+    - React-Core/RCTVibrationHeaders (= 0.62.2)
232
+    - ReactCommon/turbomodule/core (= 0.62.2)
233
+  - ReactCommon/callinvoker (0.62.2):
210
     - DoubleConversion
234
     - DoubleConversion
211
     - Folly (= 2018.10.22.00)
235
     - Folly (= 2018.10.22.00)
212
     - glog
236
     - glog
213
-    - React-cxxreact (= 0.61.5)
214
-  - ReactCommon/turbomodule/core (0.61.5):
237
+    - React-cxxreact (= 0.62.2)
238
+  - ReactCommon/turbomodule/core (0.62.2):
215
     - DoubleConversion
239
     - DoubleConversion
216
     - Folly (= 2018.10.22.00)
240
     - Folly (= 2018.10.22.00)
217
     - glog
241
     - glog
218
-    - React-Core (= 0.61.5)
219
-    - React-cxxreact (= 0.61.5)
220
-    - React-jsi (= 0.61.5)
221
-    - ReactCommon/jscallinvoker (= 0.61.5)
242
+    - React-Core (= 0.62.2)
243
+    - React-cxxreact (= 0.62.2)
244
+    - React-jsi (= 0.62.2)
245
+    - ReactCommon/callinvoker (= 0.62.2)
222
   - Yoga (1.14.0)
246
   - Yoga (1.14.0)
223
 
247
 
224
 DEPENDENCIES:
248
 DEPENDENCIES:
248
   - React-RCTSettings (from `../../node_modules/react-native/Libraries/Settings`)
272
   - React-RCTSettings (from `../../node_modules/react-native/Libraries/Settings`)
249
   - React-RCTText (from `../../node_modules/react-native/Libraries/Text`)
273
   - React-RCTText (from `../../node_modules/react-native/Libraries/Text`)
250
   - React-RCTVibration (from `../../node_modules/react-native/Libraries/Vibration`)
274
   - React-RCTVibration (from `../../node_modules/react-native/Libraries/Vibration`)
251
-  - ReactCommon/jscallinvoker (from `../../node_modules/react-native/ReactCommon`)
275
+  - ReactCommon/callinvoker (from `../../node_modules/react-native/ReactCommon`)
252
   - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`)
276
   - ReactCommon/turbomodule/core (from `../../node_modules/react-native/ReactCommon`)
253
   - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)
277
   - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)
254
 
278
 
313
 SPEC CHECKSUMS:
337
 SPEC CHECKSUMS:
314
   boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
338
   boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
315
   DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
339
   DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
316
-  FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f
317
-  FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75
340
+  FBLazyVector: 4aab18c93cd9546e4bfed752b4084585eca8b245
341
+  FBReactNativeSpec: 5465d51ccfeecb7faa12f9ae0024f2044ce4044e
318
   Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
342
   Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
319
   glog: 1f3da668190260b06b429bb211bfbee5cd790c28
343
   glog: 1f3da668190260b06b429bb211bfbee5cd790c28
320
-  RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1
321
-  RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320
322
-  React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78
323
-  React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04
324
-  React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb
325
-  React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7
326
-  React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7
327
-  React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386
328
-  React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0
329
-  react-native-webview: 1db33907230d0eb344964d6f3bb56b9ee77e25a4
330
-  React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76
331
-  React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360
332
-  React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72
333
-  React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e
334
-  React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5
335
-  React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a
336
-  React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640
337
-  React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe
338
-  React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
339
-  ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
340
-  Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
344
+  RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035
345
+  RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce
346
+  React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3
347
+  React-Core: b12bffb3f567fdf99510acb716ef1abd426e0e05
348
+  React-CoreModules: 4a9b87bbe669d6c3173c0132c3328e3b000783d0
349
+  React-cxxreact: e65f9c2ba0ac5be946f53548c1aaaee5873a8103
350
+  React-jsi: b6dc94a6a12ff98e8877287a0b7620d365201161
351
+  React-jsiexecutor: 1540d1c01bb493ae3124ed83351b1b6a155db7da
352
+  React-jsinspector: 512e560d0e985d0e8c479a54a4e5c147a9c83493
353
+  react-native-webview: cf5527893252b3b036eea024a1da6996f7344c74
354
+  React-RCTActionSheet: f41ea8a811aac770e0cc6e0ad6b270c644ea8b7c
355
+  React-RCTAnimation: 49ab98b1c1ff4445148b72a3d61554138565bad0
356
+  React-RCTBlob: a332773f0ebc413a0ce85942a55b064471587a71
357
+  React-RCTImage: e70be9b9c74fe4e42d0005f42cace7981c994ac3
358
+  React-RCTLinking: c1b9739a88d56ecbec23b7f63650e44672ab2ad2
359
+  React-RCTNetwork: 73138b6f45e5a2768ad93f3d57873c2a18d14b44
360
+  React-RCTSettings: 6e3738a87e21b39a8cb08d627e68c44acf1e325a
361
+  React-RCTText: fae545b10cfdb3d247c36c56f61a94cfd6dba41d
362
+  React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
363
+  ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
364
+  Yoga: 3ebccbdd559724312790e7742142d062476b698e
341
 
365
 
342
-PODFILE CHECKSUM: 2b0bdb79b803eefe541da6f9be6b06e99063bbfd
366
+PODFILE CHECKSUM: 767ae042fafc1aba97b301c58c340ff6f992aa27
343
 
367
 
344
-COCOAPODS: 1.8.4
368
+COCOAPODS: 1.9.1

+ 11
- 7
example/ios/example.xcodeproj/project.pbxproj Просмотреть файл

16
 		2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
16
 		2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
17
 		2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
17
 		2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
18
 		2DCD954D1E0B4F2C00145EB5 /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; };
18
 		2DCD954D1E0B4F2C00145EB5 /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; };
19
-		A08B6FFAAF3CA0F03003FEB0 /* libPods-example-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5544B310E076E06B9E2EFF4C /* libPods-example-tvOSTests.a */; };
19
+		646BD8E8CDDF5A464B5419B3 /* libPods-example-tvOS-example-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4830F7139A954350DD22DE4A /* libPods-example-tvOS-example-tvOSTests.a */; };
20
 		C7D826CF866C25BE421302B6 /* libPods-example-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F9A8A9F158876EC099CFA57A /* libPods-example-tvOS.a */; };
20
 		C7D826CF866C25BE421302B6 /* libPods-example-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F9A8A9F158876EC099CFA57A /* libPods-example-tvOS.a */; };
21
 		D0E3313DFCE78BFCB650F812 /* libPods-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CB301596D47BBAD9E9C0A45A /* libPods-exampleTests.a */; };
21
 		D0E3313DFCE78BFCB650F812 /* libPods-exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CB301596D47BBAD9E9C0A45A /* libPods-exampleTests.a */; };
22
 		E719A6E171791CD8906B3D55 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 917A19FC1EBE6E8B85FE404D /* libPods-example.a */; };
22
 		E719A6E171791CD8906B3D55 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 917A19FC1EBE6E8B85FE404D /* libPods-example.a */; };
55
 		2D02E4901E0B4A5D006451C7 /* example-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "example-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
55
 		2D02E4901E0B4A5D006451C7 /* example-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "example-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
56
 		41B6A4553C4F552488B69B01 /* Pods-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-exampleTests/Pods-exampleTests.release.xcconfig"; sourceTree = "<group>"; };
56
 		41B6A4553C4F552488B69B01 /* Pods-exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-exampleTests.release.xcconfig"; path = "Target Support Files/Pods-exampleTests/Pods-exampleTests.release.xcconfig"; sourceTree = "<group>"; };
57
 		4372A2FD2D749DE5C9FD8D3E /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
57
 		4372A2FD2D749DE5C9FD8D3E /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = "<group>"; };
58
+		4830F7139A954350DD22DE4A /* libPods-example-tvOS-example-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-tvOS-example-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
58
 		4FDD34C422D711AC8A7B10A7 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
59
 		4FDD34C422D711AC8A7B10A7 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = "<group>"; };
59
-		5544B310E076E06B9E2EFF4C /* libPods-example-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
60
 		59A4F27CAD1B7EFE80917453 /* Pods-example-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-example-tvOSTests/Pods-example-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
60
 		59A4F27CAD1B7EFE80917453 /* Pods-example-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-example-tvOSTests/Pods-example-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
61
+		6517B8E7187010A1D58A96EE /* Pods-example-tvOS-example-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOS-example-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-example-tvOS-example-tvOSTests/Pods-example-tvOS-example-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
61
 		775F6B7492793F5DB7ECE95B /* Pods-example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-example-tvOS/Pods-example-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
62
 		775F6B7492793F5DB7ECE95B /* Pods-example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-example-tvOS/Pods-example-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
62
 		8A20011E75A0AD2EC5C6EAE9 /* Pods-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-exampleTests/Pods-exampleTests.debug.xcconfig"; sourceTree = "<group>"; };
63
 		8A20011E75A0AD2EC5C6EAE9 /* Pods-exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-exampleTests/Pods-exampleTests.debug.xcconfig"; sourceTree = "<group>"; };
63
 		917A19FC1EBE6E8B85FE404D /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
64
 		917A19FC1EBE6E8B85FE404D /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
65
 		ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
66
 		ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
66
 		ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
67
 		ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
67
 		EDF80BE96CF92848F4E926EA /* Pods-example-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOS.release.xcconfig"; path = "Target Support Files/Pods-example-tvOS/Pods-example-tvOS.release.xcconfig"; sourceTree = "<group>"; };
68
 		EDF80BE96CF92848F4E926EA /* Pods-example-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOS.release.xcconfig"; path = "Target Support Files/Pods-example-tvOS/Pods-example-tvOS.release.xcconfig"; sourceTree = "<group>"; };
69
+		EE3925F4209E17ECF3E692D1 /* Pods-example-tvOS-example-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOS-example-tvOSTests.release.xcconfig"; path = "Target Support Files/Pods-example-tvOS-example-tvOSTests/Pods-example-tvOS-example-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
68
 		F67BC8D73DE103BA10A5488D /* Pods-example-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-example-tvOSTests/Pods-example-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
70
 		F67BC8D73DE103BA10A5488D /* Pods-example-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example-tvOSTests.debug.xcconfig"; path = "Target Support Files/Pods-example-tvOSTests/Pods-example-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
69
 		F9A8A9F158876EC099CFA57A /* libPods-example-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
71
 		F9A8A9F158876EC099CFA57A /* libPods-example-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
70
 /* End PBXFileReference section */
72
 /* End PBXFileReference section */
98
 			isa = PBXFrameworksBuildPhase;
100
 			isa = PBXFrameworksBuildPhase;
99
 			buildActionMask = 2147483647;
101
 			buildActionMask = 2147483647;
100
 			files = (
102
 			files = (
101
-				A08B6FFAAF3CA0F03003FEB0 /* libPods-example-tvOSTests.a in Frameworks */,
103
+				646BD8E8CDDF5A464B5419B3 /* libPods-example-tvOS-example-tvOSTests.a in Frameworks */,
102
 			);
104
 			);
103
 			runOnlyForDeploymentPostprocessing = 0;
105
 			runOnlyForDeploymentPostprocessing = 0;
104
 		};
106
 		};
143
 				ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
145
 				ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
144
 				917A19FC1EBE6E8B85FE404D /* libPods-example.a */,
146
 				917A19FC1EBE6E8B85FE404D /* libPods-example.a */,
145
 				F9A8A9F158876EC099CFA57A /* libPods-example-tvOS.a */,
147
 				F9A8A9F158876EC099CFA57A /* libPods-example-tvOS.a */,
146
-				5544B310E076E06B9E2EFF4C /* libPods-example-tvOSTests.a */,
147
 				CB301596D47BBAD9E9C0A45A /* libPods-exampleTests.a */,
148
 				CB301596D47BBAD9E9C0A45A /* libPods-exampleTests.a */,
149
+				4830F7139A954350DD22DE4A /* libPods-example-tvOS-example-tvOSTests.a */,
148
 			);
150
 			);
149
 			name = Frameworks;
151
 			name = Frameworks;
150
 			sourceTree = "<group>";
152
 			sourceTree = "<group>";
193
 				59A4F27CAD1B7EFE80917453 /* Pods-example-tvOSTests.release.xcconfig */,
195
 				59A4F27CAD1B7EFE80917453 /* Pods-example-tvOSTests.release.xcconfig */,
194
 				8A20011E75A0AD2EC5C6EAE9 /* Pods-exampleTests.debug.xcconfig */,
196
 				8A20011E75A0AD2EC5C6EAE9 /* Pods-exampleTests.debug.xcconfig */,
195
 				41B6A4553C4F552488B69B01 /* Pods-exampleTests.release.xcconfig */,
197
 				41B6A4553C4F552488B69B01 /* Pods-exampleTests.release.xcconfig */,
198
+				6517B8E7187010A1D58A96EE /* Pods-example-tvOS-example-tvOSTests.debug.xcconfig */,
199
+				EE3925F4209E17ECF3E692D1 /* Pods-example-tvOS-example-tvOSTests.release.xcconfig */,
196
 			);
200
 			);
197
 			path = Pods;
201
 			path = Pods;
198
 			sourceTree = "<group>";
202
 			sourceTree = "<group>";
402
 			outputFileListPaths = (
406
 			outputFileListPaths = (
403
 			);
407
 			);
404
 			outputPaths = (
408
 			outputPaths = (
405
-				"$(DERIVED_FILE_DIR)/Pods-example-tvOSTests-checkManifestLockResult.txt",
409
+				"$(DERIVED_FILE_DIR)/Pods-example-tvOS-example-tvOSTests-checkManifestLockResult.txt",
406
 			);
410
 			);
407
 			runOnlyForDeploymentPostprocessing = 0;
411
 			runOnlyForDeploymentPostprocessing = 0;
408
 			shellPath = /bin/sh;
412
 			shellPath = /bin/sh;
718
 		};
722
 		};
719
 		2D02E4991E0B4A5E006451C7 /* Debug */ = {
723
 		2D02E4991E0B4A5E006451C7 /* Debug */ = {
720
 			isa = XCBuildConfiguration;
724
 			isa = XCBuildConfiguration;
721
-			baseConfigurationReference = F67BC8D73DE103BA10A5488D /* Pods-example-tvOSTests.debug.xcconfig */;
725
+			baseConfigurationReference = 6517B8E7187010A1D58A96EE /* Pods-example-tvOS-example-tvOSTests.debug.xcconfig */;
722
 			buildSettings = {
726
 			buildSettings = {
723
 				BUNDLE_LOADER = "$(TEST_HOST)";
727
 				BUNDLE_LOADER = "$(TEST_HOST)";
724
 				CLANG_ANALYZER_NONNULL = YES;
728
 				CLANG_ANALYZER_NONNULL = YES;
745
 		};
749
 		};
746
 		2D02E49A1E0B4A5E006451C7 /* Release */ = {
750
 		2D02E49A1E0B4A5E006451C7 /* Release */ = {
747
 			isa = XCBuildConfiguration;
751
 			isa = XCBuildConfiguration;
748
-			baseConfigurationReference = 59A4F27CAD1B7EFE80917453 /* Pods-example-tvOSTests.release.xcconfig */;
752
+			baseConfigurationReference = EE3925F4209E17ECF3E692D1 /* Pods-example-tvOS-example-tvOSTests.release.xcconfig */;
749
 			buildSettings = {
753
 			buildSettings = {
750
 				BUNDLE_LOADER = "$(TEST_HOST)";
754
 				BUNDLE_LOADER = "$(TEST_HOST)";
751
 				CLANG_ANALYZER_NONNULL = YES;
755
 				CLANG_ANALYZER_NONNULL = YES;

+ 2
- 43
example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme Просмотреть файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <Scheme
2
 <Scheme
3
-   LastUpgradeVersion = "0940"
3
+   LastUpgradeVersion = "1130"
4
    version = "1.3">
4
    version = "1.3">
5
    <BuildAction
5
    <BuildAction
6
-      parallelizeBuildables = "NO"
6
+      parallelizeBuildables = "YES"
7
       buildImplicitDependencies = "YES">
7
       buildImplicitDependencies = "YES">
8
       <BuildActionEntries>
8
       <BuildActionEntries>
9
-         <BuildActionEntry
10
-            buildForTesting = "YES"
11
-            buildForRunning = "YES"
12
-            buildForProfiling = "YES"
13
-            buildForArchiving = "YES"
14
-            buildForAnalyzing = "YES">
15
-            <BuildableReference
16
-               BuildableIdentifier = "primary"
17
-               BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
18
-               BuildableName = "libReact.a"
19
-               BlueprintName = "React-tvOS"
20
-               ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
21
-            </BuildableReference>
22
-         </BuildActionEntry>
23
          <BuildActionEntry
9
          <BuildActionEntry
24
             buildForTesting = "YES"
10
             buildForTesting = "YES"
25
             buildForRunning = "YES"
11
             buildForRunning = "YES"
34
                ReferencedContainer = "container:example.xcodeproj">
20
                ReferencedContainer = "container:example.xcodeproj">
35
             </BuildableReference>
21
             </BuildableReference>
36
          </BuildActionEntry>
22
          </BuildActionEntry>
37
-         <BuildActionEntry
38
-            buildForTesting = "YES"
39
-            buildForRunning = "YES"
40
-            buildForProfiling = "NO"
41
-            buildForArchiving = "NO"
42
-            buildForAnalyzing = "YES">
43
-            <BuildableReference
44
-               BuildableIdentifier = "primary"
45
-               BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
46
-               BuildableName = "example-tvOSTests.xctest"
47
-               BlueprintName = "example-tvOSTests"
48
-               ReferencedContainer = "container:example.xcodeproj">
49
-            </BuildableReference>
50
-         </BuildActionEntry>
51
       </BuildActionEntries>
23
       </BuildActionEntries>
52
    </BuildAction>
24
    </BuildAction>
53
    <TestAction
25
    <TestAction
67
             </BuildableReference>
39
             </BuildableReference>
68
          </TestableReference>
40
          </TestableReference>
69
       </Testables>
41
       </Testables>
70
-      <MacroExpansion>
71
-         <BuildableReference
72
-            BuildableIdentifier = "primary"
73
-            BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
74
-            BuildableName = "example-tvOS.app"
75
-            BlueprintName = "example-tvOS"
76
-            ReferencedContainer = "container:example.xcodeproj">
77
-         </BuildableReference>
78
-      </MacroExpansion>
79
-      <AdditionalOptions>
80
-      </AdditionalOptions>
81
    </TestAction>
42
    </TestAction>
82
    <LaunchAction
43
    <LaunchAction
83
       buildConfiguration = "Debug"
44
       buildConfiguration = "Debug"
99
             ReferencedContainer = "container:example.xcodeproj">
60
             ReferencedContainer = "container:example.xcodeproj">
100
          </BuildableReference>
61
          </BuildableReference>
101
       </BuildableProductRunnable>
62
       </BuildableProductRunnable>
102
-      <AdditionalOptions>
103
-      </AdditionalOptions>
104
    </LaunchAction>
63
    </LaunchAction>
105
    <ProfileAction
64
    <ProfileAction
106
       buildConfiguration = "Release"
65
       buildConfiguration = "Release"

+ 2
- 43
example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme Просмотреть файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <Scheme
2
 <Scheme
3
-   LastUpgradeVersion = "0940"
3
+   LastUpgradeVersion = "1130"
4
    version = "1.3">
4
    version = "1.3">
5
    <BuildAction
5
    <BuildAction
6
-      parallelizeBuildables = "NO"
6
+      parallelizeBuildables = "YES"
7
       buildImplicitDependencies = "YES">
7
       buildImplicitDependencies = "YES">
8
       <BuildActionEntries>
8
       <BuildActionEntries>
9
-         <BuildActionEntry
10
-            buildForTesting = "YES"
11
-            buildForRunning = "YES"
12
-            buildForProfiling = "YES"
13
-            buildForArchiving = "YES"
14
-            buildForAnalyzing = "YES">
15
-            <BuildableReference
16
-               BuildableIdentifier = "primary"
17
-               BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
18
-               BuildableName = "libReact.a"
19
-               BlueprintName = "React"
20
-               ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
21
-            </BuildableReference>
22
-         </BuildActionEntry>
23
          <BuildActionEntry
9
          <BuildActionEntry
24
             buildForTesting = "YES"
10
             buildForTesting = "YES"
25
             buildForRunning = "YES"
11
             buildForRunning = "YES"
34
                ReferencedContainer = "container:example.xcodeproj">
20
                ReferencedContainer = "container:example.xcodeproj">
35
             </BuildableReference>
21
             </BuildableReference>
36
          </BuildActionEntry>
22
          </BuildActionEntry>
37
-         <BuildActionEntry
38
-            buildForTesting = "YES"
39
-            buildForRunning = "YES"
40
-            buildForProfiling = "NO"
41
-            buildForArchiving = "NO"
42
-            buildForAnalyzing = "YES">
43
-            <BuildableReference
44
-               BuildableIdentifier = "primary"
45
-               BlueprintIdentifier = "00E356ED1AD99517003FC87E"
46
-               BuildableName = "exampleTests.xctest"
47
-               BlueprintName = "exampleTests"
48
-               ReferencedContainer = "container:example.xcodeproj">
49
-            </BuildableReference>
50
-         </BuildActionEntry>
51
       </BuildActionEntries>
23
       </BuildActionEntries>
52
    </BuildAction>
24
    </BuildAction>
53
    <TestAction
25
    <TestAction
67
             </BuildableReference>
39
             </BuildableReference>
68
          </TestableReference>
40
          </TestableReference>
69
       </Testables>
41
       </Testables>
70
-      <MacroExpansion>
71
-         <BuildableReference
72
-            BuildableIdentifier = "primary"
73
-            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
74
-            BuildableName = "example.app"
75
-            BlueprintName = "example"
76
-            ReferencedContainer = "container:example.xcodeproj">
77
-         </BuildableReference>
78
-      </MacroExpansion>
79
-      <AdditionalOptions>
80
-      </AdditionalOptions>
81
    </TestAction>
42
    </TestAction>
82
    <LaunchAction
43
    <LaunchAction
83
       buildConfiguration = "Debug"
44
       buildConfiguration = "Debug"
99
             ReferencedContainer = "container:example.xcodeproj">
60
             ReferencedContainer = "container:example.xcodeproj">
100
          </BuildableReference>
61
          </BuildableReference>
101
       </BuildableProductRunnable>
62
       </BuildableProductRunnable>
102
-      <AdditionalOptions>
103
-      </AdditionalOptions>
104
    </LaunchAction>
63
    </LaunchAction>
105
    <ProfileAction
64
    <ProfileAction
106
       buildConfiguration = "Release"
65
       buildConfiguration = "Release"

+ 42
- 0
example/macos/Podfile Просмотреть файл

1
+require_relative '../../node_modules/@react-native-community/cli-platform-ios/native_modules'
2
+
3
+abstract_target 'Shared' do
4
+  use_native_modules!
5
+
6
+  pod 'react-native-webview', :path => "../.."
7
+
8
+  pod 'React', :path => "../../node_modules/react-native-macos/"
9
+  pod 'React-Core', :path => "../../node_modules/react-native-macos/React"
10
+  pod 'React-fishhook', :path => "../../node_modules/react-native-macos/Libraries/fishhook"
11
+  pod 'React-RCTActionSheet', :path => "../../node_modules/react-native-macos/Libraries/ActionSheetIOS"
12
+  pod 'React-RCTAnimation', :path => "../../node_modules/react-native-macos/Libraries/NativeAnimation"
13
+  pod 'React-RCTBlob', :path => "../../node_modules/react-native-macos/Libraries/Blob"
14
+  pod 'React-RCTImage', :path => "../../node_modules/react-native-macos/Libraries/Image"
15
+  pod 'React-RCTLinking', :path => "../../node_modules/react-native-macos/Libraries/LinkingIOS"
16
+  pod 'React-RCTNetwork', :path => "../../node_modules/react-native-macos/Libraries/Network"
17
+  pod 'React-RCTSettings', :path => "../../node_modules/react-native-macos/Libraries/Settings"
18
+  pod 'React-RCTText', :path => "../../node_modules/react-native-macos/Libraries/Text"
19
+  pod 'React-RCTVibration', :path => "../../node_modules/react-native-macos/Libraries/Vibration"
20
+  pod 'React-RCTWebSocket', :path => "../../node_modules/react-native-macos/Libraries/WebSocket"
21
+  pod 'React-cxxreact', :path => "../../node_modules/react-native-macos/ReactCommon/cxxreact"
22
+  pod 'React-jscallinvoker', :path => "../../node_modules/react-native-macos/ReactCommon/jscallinvoker"
23
+  pod 'React-jsi', :path => "../../node_modules/react-native-macos/ReactCommon/jsi"
24
+  pod 'React-jsiexecutor', :path => "../../node_modules/react-native-macos/ReactCommon/jsiexecutor"
25
+  pod 'React-jsinspector', :path => "../../node_modules/react-native-macos/ReactCommon/jsinspector"
26
+  pod 'yoga', :path => "../../node_modules/react-native-macos/ReactCommon/yoga"
27
+  pod 'DoubleConversion', :podspec => "../../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec"
28
+  pod 'glog', :podspec => "../../node_modules/react-native-macos/third-party-podspecs/glog.podspec"
29
+  pod 'Folly', :podspec => "../../node_modules/react-native-macos/third-party-podspecs/Folly.podspec"
30
+  pod 'boost-for-react-native', :podspec => "../../node_modules/react-native-macos/third-party-podspecs/boost-for-react-native.podspec"
31
+  pod 'React-DevSupport', :path => "../../node_modules/react-native-macos/React"
32
+
33
+  target 'example-macOS' do
34
+    platform :macos, '10.14'
35
+    # Pods specifically for macOS target
36
+  end
37
+
38
+  target 'example-iOS' do
39
+    platform :ios, '9'
40
+    # Pods specifically for iOS target
41
+  end
42
+end

+ 199
- 0
example/macos/Podfile.lock Просмотреть файл

1
+PODS:
2
+  - boost-for-react-native (1.63.0)
3
+  - DoubleConversion (1.1.6)
4
+  - Folly (2018.10.22.00):
5
+    - boost-for-react-native
6
+    - DoubleConversion
7
+    - Folly/Default (= 2018.10.22.00)
8
+    - glog
9
+  - Folly/Default (2018.10.22.00):
10
+    - boost-for-react-native
11
+    - DoubleConversion
12
+    - glog
13
+  - glog (0.3.5)
14
+  - React (0.60.0-microsoft.73):
15
+    - React-Core (= 0.60.0-microsoft.73)
16
+    - React-DevSupport (= 0.60.0-microsoft.73)
17
+    - React-RCTActionSheet (= 0.60.0-microsoft.73)
18
+    - React-RCTAnimation (= 0.60.0-microsoft.73)
19
+    - React-RCTBlob (= 0.60.0-microsoft.73)
20
+    - React-RCTImage (= 0.60.0-microsoft.73)
21
+    - React-RCTLinking (= 0.60.0-microsoft.73)
22
+    - React-RCTNetwork (= 0.60.0-microsoft.73)
23
+    - React-RCTSettings (= 0.60.0-microsoft.73)
24
+    - React-RCTText (= 0.60.0-microsoft.73)
25
+    - React-RCTVibration (= 0.60.0-microsoft.73)
26
+    - React-RCTWebSocket (= 0.60.0-microsoft.73)
27
+  - React-Core (0.60.0-microsoft.73):
28
+    - Folly (= 2018.10.22.00)
29
+    - React-cxxreact (= 0.60.0-microsoft.73)
30
+    - React-jsiexecutor (= 0.60.0-microsoft.73)
31
+    - yoga (= 0.60.0-microsoft.73.React)
32
+  - React-cxxreact (0.60.0-microsoft.73):
33
+    - boost-for-react-native (= 1.63.0)
34
+    - DoubleConversion
35
+    - Folly (= 2018.10.22.00)
36
+    - glog
37
+    - React-jsinspector (= 0.60.0-microsoft.73)
38
+  - React-DevSupport (0.60.0-microsoft.73):
39
+    - React-Core (= 0.60.0-microsoft.73)
40
+    - React-RCTWebSocket (= 0.60.0-microsoft.73)
41
+  - React-fishhook (0.60.0-microsoft.73)
42
+  - React-jscallinvoker (0.60.0-microsoft.73):
43
+    - Folly (= 2018.10.22.00)
44
+    - React-cxxreact (= 0.60.0-microsoft.73)
45
+  - React-jsi (0.60.0-microsoft.73):
46
+    - boost-for-react-native (= 1.63.0)
47
+    - DoubleConversion
48
+    - Folly (= 2018.10.22.00)
49
+    - glog
50
+    - React-jsi/Default (= 0.60.0-microsoft.73)
51
+  - React-jsi/Default (0.60.0-microsoft.73):
52
+    - boost-for-react-native (= 1.63.0)
53
+    - DoubleConversion
54
+    - Folly (= 2018.10.22.00)
55
+    - glog
56
+  - React-jsiexecutor (0.60.0-microsoft.73):
57
+    - DoubleConversion
58
+    - Folly (= 2018.10.22.00)
59
+    - glog
60
+    - React-cxxreact (= 0.60.0-microsoft.73)
61
+    - React-jsi (= 0.60.0-microsoft.73)
62
+  - React-jsinspector (0.60.0-microsoft.73)
63
+  - react-native-webview (9.2.1):
64
+    - React
65
+  - React-RCTActionSheet (0.60.0-microsoft.73):
66
+    - React-Core (= 0.60.0-microsoft.73)
67
+  - React-RCTAnimation (0.60.0-microsoft.73):
68
+    - React-Core (= 0.60.0-microsoft.73)
69
+  - React-RCTBlob (0.60.0-microsoft.73):
70
+    - React-Core (= 0.60.0-microsoft.73)
71
+    - React-RCTNetwork (= 0.60.0-microsoft.73)
72
+    - React-RCTWebSocket (= 0.60.0-microsoft.73)
73
+  - React-RCTImage (0.60.0-microsoft.73):
74
+    - React-Core (= 0.60.0-microsoft.73)
75
+    - React-RCTNetwork (= 0.60.0-microsoft.73)
76
+  - React-RCTLinking (0.60.0-microsoft.73):
77
+    - React-Core (= 0.60.0-microsoft.73)
78
+  - React-RCTNetwork (0.60.0-microsoft.73):
79
+    - React-Core (= 0.60.0-microsoft.73)
80
+  - React-RCTSettings (0.60.0-microsoft.73):
81
+    - React-Core (= 0.60.0-microsoft.73)
82
+  - React-RCTText (0.60.0-microsoft.73):
83
+    - React-Core (= 0.60.0-microsoft.73)
84
+  - React-RCTVibration (0.60.0-microsoft.73):
85
+    - React-Core (= 0.60.0-microsoft.73)
86
+  - React-RCTWebSocket (0.60.0-microsoft.73):
87
+    - React-Core (= 0.60.0-microsoft.73)
88
+    - React-fishhook (= 0.60.0-microsoft.73)
89
+  - yoga (0.60.0-microsoft.73.React)
90
+
91
+DEPENDENCIES:
92
+  - boost-for-react-native (from `../../node_modules/react-native-macos/third-party-podspecs/boost-for-react-native.podspec`)
93
+  - DoubleConversion (from `../../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec`)
94
+  - Folly (from `../../node_modules/react-native-macos/third-party-podspecs/Folly.podspec`)
95
+  - glog (from `../../node_modules/react-native-macos/third-party-podspecs/glog.podspec`)
96
+  - React (from `../../node_modules/react-native-macos/`)
97
+  - React-Core (from `../../node_modules/react-native-macos/React`)
98
+  - React-cxxreact (from `../../node_modules/react-native-macos/ReactCommon/cxxreact`)
99
+  - React-DevSupport (from `../../node_modules/react-native-macos/React`)
100
+  - React-fishhook (from `../../node_modules/react-native-macos/Libraries/fishhook`)
101
+  - React-jscallinvoker (from `../../node_modules/react-native-macos/ReactCommon/jscallinvoker`)
102
+  - React-jsi (from `../../node_modules/react-native-macos/ReactCommon/jsi`)
103
+  - React-jsiexecutor (from `../../node_modules/react-native-macos/ReactCommon/jsiexecutor`)
104
+  - React-jsinspector (from `../../node_modules/react-native-macos/ReactCommon/jsinspector`)
105
+  - react-native-webview (from `../..`)
106
+  - React-RCTActionSheet (from `../../node_modules/react-native-macos/Libraries/ActionSheetIOS`)
107
+  - React-RCTAnimation (from `../../node_modules/react-native-macos/Libraries/NativeAnimation`)
108
+  - React-RCTBlob (from `../../node_modules/react-native-macos/Libraries/Blob`)
109
+  - React-RCTImage (from `../../node_modules/react-native-macos/Libraries/Image`)
110
+  - React-RCTLinking (from `../../node_modules/react-native-macos/Libraries/LinkingIOS`)
111
+  - React-RCTNetwork (from `../../node_modules/react-native-macos/Libraries/Network`)
112
+  - React-RCTSettings (from `../../node_modules/react-native-macos/Libraries/Settings`)
113
+  - React-RCTText (from `../../node_modules/react-native-macos/Libraries/Text`)
114
+  - React-RCTVibration (from `../../node_modules/react-native-macos/Libraries/Vibration`)
115
+  - React-RCTWebSocket (from `../../node_modules/react-native-macos/Libraries/WebSocket`)
116
+  - yoga (from `../../node_modules/react-native-macos/ReactCommon/yoga`)
117
+
118
+EXTERNAL SOURCES:
119
+  boost-for-react-native:
120
+    :podspec: "../../node_modules/react-native-macos/third-party-podspecs/boost-for-react-native.podspec"
121
+  DoubleConversion:
122
+    :podspec: "../../node_modules/react-native-macos/third-party-podspecs/DoubleConversion.podspec"
123
+  Folly:
124
+    :podspec: "../../node_modules/react-native-macos/third-party-podspecs/Folly.podspec"
125
+  glog:
126
+    :podspec: "../../node_modules/react-native-macos/third-party-podspecs/glog.podspec"
127
+  React:
128
+    :path: "../../node_modules/react-native-macos/"
129
+  React-Core:
130
+    :path: "../../node_modules/react-native-macos/React"
131
+  React-cxxreact:
132
+    :path: "../../node_modules/react-native-macos/ReactCommon/cxxreact"
133
+  React-DevSupport:
134
+    :path: "../../node_modules/react-native-macos/React"
135
+  React-fishhook:
136
+    :path: "../../node_modules/react-native-macos/Libraries/fishhook"
137
+  React-jscallinvoker:
138
+    :path: "../../node_modules/react-native-macos/ReactCommon/jscallinvoker"
139
+  React-jsi:
140
+    :path: "../../node_modules/react-native-macos/ReactCommon/jsi"
141
+  React-jsiexecutor:
142
+    :path: "../../node_modules/react-native-macos/ReactCommon/jsiexecutor"
143
+  React-jsinspector:
144
+    :path: "../../node_modules/react-native-macos/ReactCommon/jsinspector"
145
+  react-native-webview:
146
+    :path: "../.."
147
+  React-RCTActionSheet:
148
+    :path: "../../node_modules/react-native-macos/Libraries/ActionSheetIOS"
149
+  React-RCTAnimation:
150
+    :path: "../../node_modules/react-native-macos/Libraries/NativeAnimation"
151
+  React-RCTBlob:
152
+    :path: "../../node_modules/react-native-macos/Libraries/Blob"
153
+  React-RCTImage:
154
+    :path: "../../node_modules/react-native-macos/Libraries/Image"
155
+  React-RCTLinking:
156
+    :path: "../../node_modules/react-native-macos/Libraries/LinkingIOS"
157
+  React-RCTNetwork:
158
+    :path: "../../node_modules/react-native-macos/Libraries/Network"
159
+  React-RCTSettings:
160
+    :path: "../../node_modules/react-native-macos/Libraries/Settings"
161
+  React-RCTText:
162
+    :path: "../../node_modules/react-native-macos/Libraries/Text"
163
+  React-RCTVibration:
164
+    :path: "../../node_modules/react-native-macos/Libraries/Vibration"
165
+  React-RCTWebSocket:
166
+    :path: "../../node_modules/react-native-macos/Libraries/WebSocket"
167
+  yoga:
168
+    :path: "../../node_modules/react-native-macos/ReactCommon/yoga"
169
+
170
+SPEC CHECKSUMS:
171
+  boost-for-react-native: a110407d9db2642fd2e1bcd7c5a51c81f2521dc9
172
+  DoubleConversion: a1bc12a74baa397a2609e0f10e19b8062d864053
173
+  Folly: feff29ba9d0b7c2e4f793a94942831d6cc5bbad7
174
+  glog: b3f6d74f3e2d33396addc0ee724d2b2b79fc3e00
175
+  React: 4d79a1cdf3230e04aca581c25efee08da1ee5164
176
+  React-Core: 13ba8f1abdf6bcd5ff0f483a9ef7a2db9a107f0e
177
+  React-cxxreact: 11924907362f4cac7420b882760f939eb126ea26
178
+  React-DevSupport: ad7a5fc590659aeccfbf865fc4a134b70436d648
179
+  React-fishhook: 4990f5c5822d79c7ab3fb76c79ac17d09bee9336
180
+  React-jscallinvoker: 3a2e5ca0f66931ede7f55dfa2c3678983b668e86
181
+  React-jsi: 62b3cdf6e9a83d5c18dcf7dc895a362fb4b7853b
182
+  React-jsiexecutor: 8bd40a456b96ac807634225efa05ac2c35894dd0
183
+  React-jsinspector: c549193caebd0004cf2df489c57c5a24614c5516
184
+  react-native-webview: d75854c6508447f78d548dbdfbfc9a2049c3b1c5
185
+  React-RCTActionSheet: 7d7c2282c5a782e7a13f8da967eb2fe6ba296847
186
+  React-RCTAnimation: 289ab0e35a77a2f585fd2743b6abf7d52fac7a5b
187
+  React-RCTBlob: fff2b91fe158a258b72e610d5e0f77db4e059bef
188
+  React-RCTImage: cc560497ac826ca385dff28e631233ec8d1b95a6
189
+  React-RCTLinking: 6d4ed366a86755fba71a0446e5ee33e9944d8c0a
190
+  React-RCTNetwork: 15ce6970143dd7883db946b97d822098a1f9fc98
191
+  React-RCTSettings: 4729f1553af00f2f073a3e4a9743e6d35578afd6
192
+  React-RCTText: e5c12c5085188057d606c6627d8022c9983226b8
193
+  React-RCTVibration: 19f2176d53ccf811cc56dc333e538ae2f3a3822c
194
+  React-RCTWebSocket: ed4f366970f1cb6280a2edf6402aaebb224cd5ef
195
+  yoga: 94752fd7c7be3ab04256ef648abc656f52d77501
196
+
197
+PODFILE CHECKSUM: 57ba7807ee34b3b25a5ef3497860eaf96be05af7
198
+
199
+COCOAPODS: 1.8.4

example/macos/example/AppDelegate.h → example/macos/example-iOS/AppDelegate.h Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import <React/RCTBridgeDelegate.h>
1
 #import <React/RCTBridgeDelegate.h>
9
 #import <UIKit/UIKit.h>
2
 #import <UIKit/UIKit.h>
10
 
3
 

example/macos/example/AppDelegate.m → example/macos/example-iOS/AppDelegate.m Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import "AppDelegate.h"
1
 #import "AppDelegate.h"
9
 
2
 
10
 #import <React/RCTBridge.h>
3
 #import <React/RCTBridge.h>

example/macos/example/Base.lproj/LaunchScreen.xib → example/macos/example-iOS/Base.lproj/LaunchScreen.xib Просмотреть файл


example/macos/example/Images.xcassets/AppIcon.appiconset/Contents.json → example/macos/example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json Просмотреть файл

1
 {
1
 {
2
   "images" : [
2
   "images" : [
3
-    {
4
-      "idiom" : "iphone",
5
-      "size" : "20x20",
6
-      "scale" : "2x"
7
-    },
8
-    {
9
-      "idiom" : "iphone",
10
-      "size" : "20x20",
11
-      "scale" : "3x"
12
-    },
13
     {
3
     {
14
       "idiom" : "iphone",
4
       "idiom" : "iphone",
15
       "size" : "29x29",
5
       "size" : "29x29",
39
       "idiom" : "iphone",
29
       "idiom" : "iphone",
40
       "size" : "60x60",
30
       "size" : "60x60",
41
       "scale" : "3x"
31
       "scale" : "3x"
42
-    },
43
-    {
44
-      "idiom" : "ios-marketing",
45
-      "size" : "1024x1024",
46
-      "scale" : "1x"
47
     }
32
     }
48
   ],
33
   ],
49
   "info" : {
34
   "info" : {

example/macos/example/Images.xcassets/Contents.json → example/macos/example-iOS/Images.xcassets/Contents.json Просмотреть файл


example/macos/example/Info.plist → example/macos/example-iOS/Info.plist Просмотреть файл

5
 	<key>CFBundleDevelopmentRegion</key>
5
 	<key>CFBundleDevelopmentRegion</key>
6
 	<string>en</string>
6
 	<string>en</string>
7
 	<key>CFBundleDisplayName</key>
7
 	<key>CFBundleDisplayName</key>
8
-	<string>example</string>
8
+	<string>$(PRODUCT_NAME)</string>
9
 	<key>CFBundleExecutable</key>
9
 	<key>CFBundleExecutable</key>
10
 	<string>$(EXECUTABLE_NAME)</string>
10
 	<string>$(EXECUTABLE_NAME)</string>
11
 	<key>CFBundleIdentifier</key>
11
 	<key>CFBundleIdentifier</key>

example/macos/example/main.m → example/macos/example-iOS/main.m Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import <UIKit/UIKit.h>
1
 #import <UIKit/UIKit.h>
9
 
2
 
10
 #import "AppDelegate.h"
3
 #import "AppDelegate.h"

+ 0
- 7
example/macos/example-macOS/AppDelegate.h Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import <Cocoa/Cocoa.h>
1
 #import <Cocoa/Cocoa.h>
9
 
2
 
10
 @class RCTBridge;
3
 @class RCTBridge;

+ 0
- 7
example/macos/example-macOS/AppDelegate.m Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import "AppDelegate.h"
1
 #import "AppDelegate.h"
9
 
2
 
10
 #import <React/RCTBridge.h>
3
 #import <React/RCTBridge.h>

+ 58
- 0
example/macos/example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json Просмотреть файл

1
+{
2
+  "images" : [
3
+    {
4
+      "idiom" : "mac",
5
+      "scale" : "1x",
6
+      "size" : "16x16"
7
+    },
8
+    {
9
+      "idiom" : "mac",
10
+      "scale" : "2x",
11
+      "size" : "16x16"
12
+    },
13
+    {
14
+      "idiom" : "mac",
15
+      "scale" : "1x",
16
+      "size" : "32x32"
17
+    },
18
+    {
19
+      "idiom" : "mac",
20
+      "scale" : "2x",
21
+      "size" : "32x32"
22
+    },
23
+    {
24
+      "idiom" : "mac",
25
+      "scale" : "1x",
26
+      "size" : "128x128"
27
+    },
28
+    {
29
+      "idiom" : "mac",
30
+      "scale" : "2x",
31
+      "size" : "128x128"
32
+    },
33
+    {
34
+      "idiom" : "mac",
35
+      "scale" : "1x",
36
+      "size" : "256x256"
37
+    },
38
+    {
39
+      "idiom" : "mac",
40
+      "scale" : "2x",
41
+      "size" : "256x256"
42
+    },
43
+    {
44
+      "idiom" : "mac",
45
+      "scale" : "1x",
46
+      "size" : "512x512"
47
+    },
48
+    {
49
+      "idiom" : "mac",
50
+      "scale" : "2x",
51
+      "size" : "512x512"
52
+    }
53
+  ],
54
+  "info" : {
55
+    "author" : "xcode",
56
+    "version" : 1
57
+  }
58
+}

+ 6
- 0
example/macos/example-macOS/Assets.xcassets/Contents.json Просмотреть файл

1
+{
2
+  "info" : {
3
+    "author" : "xcode",
4
+    "version" : 1
5
+  }
6
+}

example/macos/example-macOS/Main.storyboard → example/macos/example-macOS/Base.lproj/Main.storyboard Просмотреть файл

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
3
     <dependencies>
3
     <dependencies>
4
-        <deployment identifier="macosx"/>
5
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15505"/>
6
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
4
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
7
     </dependencies>
5
     </dependencies>
8
     <scenes>
6
     <scenes>
9
         <!--Application-->
7
         <!--Application-->
12
                 <application id="hnw-xV-0zn" sceneMemberID="viewController">
10
                 <application id="hnw-xV-0zn" sceneMemberID="viewController">
13
                     <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
11
                     <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
14
                         <items>
12
                         <items>
15
-                            <menuItem title="rncTesterApp-macOS" id="1Xt-HY-uBw">
13
+                            <menuItem title="example" id="1Xt-HY-uBw">
16
                                 <modifierMask key="keyEquivalentModifierMask"/>
14
                                 <modifierMask key="keyEquivalentModifierMask"/>
17
-                                <menu key="submenu" title="rncTesterApp-macOS" systemMenu="apple" id="uQy-DD-JDr">
15
+                                <menu key="submenu" title="example" systemMenu="apple" id="uQy-DD-JDr">
18
                                     <items>
16
                                     <items>
19
-                                        <menuItem title="About rncTesterApp-macOS" id="5kV-Vb-QxS">
17
+                                        <menuItem title="About example" id="5kV-Vb-QxS">
20
                                             <modifierMask key="keyEquivalentModifierMask"/>
18
                                             <modifierMask key="keyEquivalentModifierMask"/>
21
                                             <connections>
19
                                             <connections>
22
                                                 <action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
20
                                                 <action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
30
                                             <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
28
                                             <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
31
                                         </menuItem>
29
                                         </menuItem>
32
                                         <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
30
                                         <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
33
-                                        <menuItem title="Hide rncTesterApp-macOS" keyEquivalent="h" id="Olw-nP-bQN">
31
+                                        <menuItem title="Hide example" keyEquivalent="h" id="Olw-nP-bQN">
34
                                             <connections>
32
                                             <connections>
35
                                                 <action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
33
                                                 <action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
36
                                             </connections>
34
                                             </connections>
48
                                             </connections>
46
                                             </connections>
49
                                         </menuItem>
47
                                         </menuItem>
50
                                         <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
48
                                         <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
51
-                                        <menuItem title="Quit rncTesterApp-macOS" keyEquivalent="q" id="4sb-4s-VLi">
49
+                                        <menuItem title="Quit example" keyEquivalent="q" id="4sb-4s-VLi">
52
                                             <connections>
50
                                             <connections>
53
                                                 <action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
51
                                                 <action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
54
                                             </connections>
52
                                             </connections>
526
                                                                 <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
524
                                                                 <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
527
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
525
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
528
                                                                 </menuItem>
526
                                                                 </menuItem>
529
-                                                                <menuItem title="  Default" id="YGs-j5-SAR">
527
+                                                                <menuItem id="YGs-j5-SAR">
528
+                                                                    <string key="title">	Default</string>
530
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
529
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
531
                                                                     <connections>
530
                                                                     <connections>
532
                                                                         <action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
531
                                                                         <action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
533
                                                                     </connections>
532
                                                                     </connections>
534
                                                                 </menuItem>
533
                                                                 </menuItem>
535
-                                                                <menuItem title="  Left to Right" id="Lbh-J2-qVU">
534
+                                                                <menuItem id="Lbh-J2-qVU">
535
+                                                                    <string key="title">	Left to Right</string>
536
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
536
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
537
                                                                     <connections>
537
                                                                     <connections>
538
                                                                         <action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
538
                                                                         <action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
539
                                                                     </connections>
539
                                                                     </connections>
540
                                                                 </menuItem>
540
                                                                 </menuItem>
541
-                                                                <menuItem title="  Right to Left" id="jFq-tB-4Kx">
541
+                                                                <menuItem id="jFq-tB-4Kx">
542
+                                                                    <string key="title">	Right to Left</string>
542
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
543
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
543
                                                                     <connections>
544
                                                                     <connections>
544
                                                                         <action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
545
                                                                         <action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
548
                                                                 <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
549
                                                                 <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
549
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
550
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
550
                                                                 </menuItem>
551
                                                                 </menuItem>
551
-                                                                <menuItem title="  Default" id="Nop-cj-93Q">
552
+                                                                <menuItem id="Nop-cj-93Q">
553
+                                                                    <string key="title">	Default</string>
552
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
554
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
553
                                                                     <connections>
555
                                                                     <connections>
554
                                                                         <action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
556
                                                                         <action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
555
                                                                     </connections>
557
                                                                     </connections>
556
                                                                 </menuItem>
558
                                                                 </menuItem>
557
-                                                                <menuItem title="  Left to Right" id="BgM-ve-c93">
559
+                                                                <menuItem id="BgM-ve-c93">
560
+                                                                    <string key="title">	Left to Right</string>
558
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
561
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
559
                                                                     <connections>
562
                                                                     <connections>
560
                                                                         <action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
563
                                                                         <action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
561
                                                                     </connections>
564
                                                                     </connections>
562
                                                                 </menuItem>
565
                                                                 </menuItem>
563
-                                                                <menuItem title="  Right to Left" id="RB4-Sm-HuC">
566
+                                                                <menuItem id="RB4-Sm-HuC">
567
+                                                                    <string key="title">	Right to Left</string>
564
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
568
                                                                     <modifierMask key="keyEquivalentModifierMask"/>
565
                                                                     <connections>
569
                                                                     <connections>
566
                                                                         <action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
570
                                                                         <action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
655
                                 <modifierMask key="keyEquivalentModifierMask"/>
659
                                 <modifierMask key="keyEquivalentModifierMask"/>
656
                                 <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
660
                                 <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
657
                                     <items>
661
                                     <items>
658
-                                        <menuItem title="rncTesterApp-macOS Help" keyEquivalent="?" id="FKE-Sm-Kum">
662
+                                        <menuItem title="example Help" keyEquivalent="?" id="FKE-Sm-Kum">
659
                                             <connections>
663
                                             <connections>
660
                                                 <action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
664
                                                 <action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
661
                                             </connections>
665
                                             </connections>
669
                         <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
673
                         <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
670
                     </connections>
674
                     </connections>
671
                 </application>
675
                 </application>
672
-                <customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
676
+                <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider=""/>
673
                 <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
677
                 <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
674
                 <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
678
                 <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
675
             </objects>
679
             </objects>
679
         <scene sceneID="R2V-B0-nI4">
683
         <scene sceneID="R2V-B0-nI4">
680
             <objects>
684
             <objects>
681
                 <windowController id="B8D-0N-5wS" sceneMemberID="viewController">
685
                 <windowController id="B8D-0N-5wS" sceneMemberID="viewController">
682
-                    <window key="window" title="example macOS" allowsToolTipsWhenApplicationIsInactive="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
686
+                    <window key="window" title="example" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
683
                         <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
687
                         <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
684
                         <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
688
                         <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
685
                         <rect key="contentRect" x="196" y="240" width="480" height="270"/>
689
                         <rect key="contentRect" x="196" y="240" width="480" height="270"/>
699
         <!--View Controller-->
703
         <!--View Controller-->
700
         <scene sceneID="hIz-AP-VOD">
704
         <scene sceneID="hIz-AP-VOD">
701
             <objects>
705
             <objects>
702
-                <viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
703
-                    <view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
706
+                <viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
707
+                    <view key="view" id="m2S-Jp-Qdl">
704
                         <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
708
                         <rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
705
                         <autoresizingMask key="autoresizingMask"/>
709
                         <autoresizingMask key="autoresizingMask"/>
706
                     </view>
710
                     </view>

+ 17
- 15
example/macos/example-macOS/Info.plist Просмотреть файл

15
 	<key>CFBundleName</key>
15
 	<key>CFBundleName</key>
16
 	<string>$(PRODUCT_NAME)</string>
16
 	<string>$(PRODUCT_NAME)</string>
17
 	<key>CFBundlePackageType</key>
17
 	<key>CFBundlePackageType</key>
18
-	<string>APPL</string>
18
+	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19
 	<key>CFBundleShortVersionString</key>
19
 	<key>CFBundleShortVersionString</key>
20
 	<string>1.0</string>
20
 	<string>1.0</string>
21
 	<key>CFBundleVersion</key>
21
 	<key>CFBundleVersion</key>
23
 	<key>LSMinimumSystemVersion</key>
23
 	<key>LSMinimumSystemVersion</key>
24
 	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
24
 	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
25
 	<key>NSAppTransportSecurity</key>
25
 	<key>NSAppTransportSecurity</key>
26
-	<dict>
27
-		<key>NSAllowsArbitraryLoads</key>
28
-		<true/>
29
-		<key>NSExceptionDomains</key>
30
-		<dict>
31
-			<key>localhost</key>
32
-			<dict>
33
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
34
-				<true/>
35
-			</dict>
36
-		</dict>
37
-	</dict>
38
-	<key>NSHumanReadableCopyright</key>
39
-	<string>Copyright © 2017 Facebook. All rights reserved.</string>
26
+ 	<dict>
27
+ 		<key>NSAllowsArbitraryLoads</key>
28
+ 		<true/>
29
+ 		<key>NSExceptionDomains</key>
30
+ 		<dict>
31
+ 			<key>localhost</key>
32
+ 			<dict>
33
+ 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
34
+ 				<true/>
35
+ 			</dict>
36
+ 		</dict>
37
+ 	</dict>
40
 	<key>NSMainStoryboardFile</key>
38
 	<key>NSMainStoryboardFile</key>
41
 	<string>Main</string>
39
 	<string>Main</string>
42
 	<key>NSPrincipalClass</key>
40
 	<key>NSPrincipalClass</key>
43
 	<string>NSApplication</string>
41
 	<string>NSApplication</string>
42
+	<key>NSSupportsAutomaticTermination</key>
43
+	<true/>
44
+	<key>NSSupportsSuddenTermination</key>
45
+	<true/>
44
 </dict>
46
 </dict>
45
 </plist>
47
 </plist>

+ 0
- 7
example/macos/example-macOS/ViewController.h Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import <Cocoa/Cocoa.h>
1
 #import <Cocoa/Cocoa.h>
9
 
2
 
10
 @interface ViewController : NSViewController
3
 @interface ViewController : NSViewController

+ 0
- 7
example/macos/example-macOS/ViewController.m Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import "ViewController.h"
1
 #import "ViewController.h"
9
 #import "AppDelegate.h"
2
 #import "AppDelegate.h"
10
 
3
 

+ 12
- 0
example/macos/example-macOS/example.entitlements Просмотреть файл

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>com.apple.security.app-sandbox</key>
6
+	<true/>
7
+	<key>com.apple.security.files.user-selected.read-only</key>
8
+	<true/>
9
+	<key>com.apple.security.network.client</key>
10
+	<true/>
11
+</dict>
12
+</plist>

+ 0
- 7
example/macos/example-macOS/main.m Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
 #import <Cocoa/Cocoa.h>
1
 #import <Cocoa/Cocoa.h>
9
 
2
 
10
 int main(int argc, const char *argv[]) {
3
 int main(int argc, const char *argv[]) {

+ 606
- 1569
example/macos/example.xcodeproj/project.pbxproj
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


example/macos/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme → example/macos/example.xcodeproj/xcshareddata/xcschemes/example-iOS.xcscheme Просмотреть файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <Scheme
2
 <Scheme
3
-   LastUpgradeVersion = "1120"
3
+   LastUpgradeVersion = "1140"
4
    version = "1.3">
4
    version = "1.3">
5
    <BuildAction
5
    <BuildAction
6
-      parallelizeBuildables = "NO"
6
+      parallelizeBuildables = "YES"
7
       buildImplicitDependencies = "YES">
7
       buildImplicitDependencies = "YES">
8
       <BuildActionEntries>
8
       <BuildActionEntries>
9
-         <BuildActionEntry
10
-            buildForTesting = "YES"
11
-            buildForRunning = "YES"
12
-            buildForProfiling = "YES"
13
-            buildForArchiving = "YES"
14
-            buildForAnalyzing = "YES">
15
-            <BuildableReference
16
-               BuildableIdentifier = "primary"
17
-               BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
18
-               BuildableName = "libReact.a"
19
-               BlueprintName = "React"
20
-               ReferencedContainer = "container:../../node_modules/react-native-macos/React/React.xcodeproj">
21
-            </BuildableReference>
22
-         </BuildActionEntry>
23
          <BuildActionEntry
9
          <BuildActionEntry
24
             buildForTesting = "YES"
10
             buildForTesting = "YES"
25
             buildForRunning = "YES"
11
             buildForRunning = "YES"
30
                BuildableIdentifier = "primary"
16
                BuildableIdentifier = "primary"
31
                BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
17
                BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
32
                BuildableName = "example.app"
18
                BuildableName = "example.app"
33
-               BlueprintName = "example"
19
+               BlueprintName = "example-iOS"
34
                ReferencedContainer = "container:example.xcodeproj">
20
                ReferencedContainer = "container:example.xcodeproj">
35
             </BuildableReference>
21
             </BuildableReference>
36
          </BuildActionEntry>
22
          </BuildActionEntry>
60
             BuildableIdentifier = "primary"
46
             BuildableIdentifier = "primary"
61
             BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
47
             BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
62
             BuildableName = "example.app"
48
             BuildableName = "example.app"
63
-            BlueprintName = "example"
49
+            BlueprintName = "example-iOS"
64
             ReferencedContainer = "container:example.xcodeproj">
50
             ReferencedContainer = "container:example.xcodeproj">
65
          </BuildableReference>
51
          </BuildableReference>
66
       </BuildableProductRunnable>
52
       </BuildableProductRunnable>
77
             BuildableIdentifier = "primary"
63
             BuildableIdentifier = "primary"
78
             BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
64
             BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
79
             BuildableName = "example.app"
65
             BuildableName = "example.app"
80
-            BlueprintName = "example"
66
+            BlueprintName = "example-iOS"
81
             ReferencedContainer = "container:example.xcodeproj">
67
             ReferencedContainer = "container:example.xcodeproj">
82
          </BuildableReference>
68
          </BuildableReference>
83
       </BuildableProductRunnable>
69
       </BuildableProductRunnable>

+ 8
- 22
example/macos/example.xcodeproj/xcshareddata/xcschemes/example-macOS.xcscheme Просмотреть файл

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <Scheme
2
 <Scheme
3
-   LastUpgradeVersion = "1120"
3
+   LastUpgradeVersion = "1140"
4
    version = "1.3">
4
    version = "1.3">
5
    <BuildAction
5
    <BuildAction
6
-      parallelizeBuildables = "NO"
6
+      parallelizeBuildables = "YES"
7
       buildImplicitDependencies = "YES">
7
       buildImplicitDependencies = "YES">
8
       <BuildActionEntries>
8
       <BuildActionEntries>
9
          <BuildActionEntry
9
          <BuildActionEntry
14
             buildForAnalyzing = "YES">
14
             buildForAnalyzing = "YES">
15
             <BuildableReference
15
             <BuildableReference
16
                BuildableIdentifier = "primary"
16
                BuildableIdentifier = "primary"
17
-               BlueprintIdentifier = "6B857DA21EC51FC600A9D063"
18
-               BuildableName = "libReact.a"
19
-               BlueprintName = "React-macOS"
20
-               ReferencedContainer = "container:../../node_modules/react-native-macos/React/React.xcodeproj">
21
-            </BuildableReference>
22
-         </BuildActionEntry>
23
-         <BuildActionEntry
24
-            buildForTesting = "YES"
25
-            buildForRunning = "YES"
26
-            buildForProfiling = "YES"
27
-            buildForArchiving = "YES"
28
-            buildForAnalyzing = "YES">
29
-            <BuildableReference
30
-               BuildableIdentifier = "primary"
31
-               BlueprintIdentifier = "38C1415723BBE33000902604"
32
-               BuildableName = "example-macOS.app"
17
+               BlueprintIdentifier = "514201482437B4B30078DB4F"
18
+               BuildableName = "example.app"
33
                BlueprintName = "example-macOS"
19
                BlueprintName = "example-macOS"
34
                ReferencedContainer = "container:example.xcodeproj">
20
                ReferencedContainer = "container:example.xcodeproj">
35
             </BuildableReference>
21
             </BuildableReference>
58
          runnableDebuggingMode = "0">
44
          runnableDebuggingMode = "0">
59
          <BuildableReference
45
          <BuildableReference
60
             BuildableIdentifier = "primary"
46
             BuildableIdentifier = "primary"
61
-            BlueprintIdentifier = "38C1415723BBE33000902604"
62
-            BuildableName = "example-macOS.app"
47
+            BlueprintIdentifier = "514201482437B4B30078DB4F"
48
+            BuildableName = "example.app"
63
             BlueprintName = "example-macOS"
49
             BlueprintName = "example-macOS"
64
             ReferencedContainer = "container:example.xcodeproj">
50
             ReferencedContainer = "container:example.xcodeproj">
65
          </BuildableReference>
51
          </BuildableReference>
75
          runnableDebuggingMode = "0">
61
          runnableDebuggingMode = "0">
76
          <BuildableReference
62
          <BuildableReference
77
             BuildableIdentifier = "primary"
63
             BuildableIdentifier = "primary"
78
-            BlueprintIdentifier = "38C1415723BBE33000902604"
79
-            BuildableName = "example-macOS.app"
64
+            BlueprintIdentifier = "514201482437B4B30078DB4F"
65
+            BuildableName = "example.app"
80
             BlueprintName = "example-macOS"
66
             BlueprintName = "example-macOS"
81
             ReferencedContainer = "container:example.xcodeproj">
67
             ReferencedContainer = "container:example.xcodeproj">
82
          </BuildableReference>
68
          </BuildableReference>

+ 10
- 0
example/macos/example.xcworkspace/contents.xcworkspacedata Просмотреть файл

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Workspace
3
+   version = "1.0">
4
+   <FileRef
5
+      location = "group:example.xcodeproj">
6
+   </FileRef>
7
+   <FileRef
8
+      location = "group:Pods/Pods.xcodeproj">
9
+   </FileRef>
10
+</Workspace>

example/macos/example.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → example/macos/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist Просмотреть файл

2
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
 <plist version="1.0">
3
 <plist version="1.0">
4
 <dict>
4
 <dict>
5
-	<key>BuildSystemType</key>
6
-	<string>Original</string>
7
-	<key>PreviewsEnabled</key>
8
-	<false/>
5
+	<key>IDEDidComputeMac32BitWarning</key>
6
+	<true/>
9
 </dict>
7
 </dict>
10
 </plist>
8
 </plist>

+ 1
- 0
example/windows/.gitignore Просмотреть файл

1
 *AppPackages*
1
 *AppPackages*
2
 *BundleArtifacts*
2
 *BundleArtifacts*
3
+*Bundle
3
 
4
 
4
 #OS junk files
5
 #OS junk files
5
 [Tt]humbs.db
6
 [Tt]humbs.db

+ 1
- 0
example/windows/WebViewWindows.sln Просмотреть файл

55
 		..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
55
 		..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
56
 		..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
56
 		..\..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
57
 		..\..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
57
 		..\..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
58
+		..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
58
 		..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
59
 		..\..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
59
 		..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
60
 		..\..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
60
 	EndGlobalSection
61
 	EndGlobalSection

+ 0
- 5
example/windows/WebViewWindows/App.cpp Просмотреть файл

37
     PackageProviders().Append(winrt::ReactNativeWebView::ReactPackageProvider());
37
     PackageProviders().Append(winrt::ReactNativeWebView::ReactPackageProvider());
38
 
38
 
39
     InitializeComponent();
39
     InitializeComponent();
40
-
41
-    // This works around a cpp/winrt bug with composable/aggregable types tracked
42
-    // by 22116519
43
-    AddRef();
44
-    m_inner.as<::IUnknown>()->Release();
45
 }
40
 }
46
 
41
 
47
 
42
 

+ 1
- 1
example/windows/WebViewWindows/Package.appxmanifest Просмотреть файл

7
   IgnorableNamespaces="uap mp">
7
   IgnorableNamespaces="uap mp">
8
 
8
 
9
  <Identity
9
  <Identity
10
-    Name="6b4ef5e9-85c1-4006-87d7-77c61c62f84f"
10
+    Name="WebViewWindows"
11
     Publisher="CN=kaigu"
11
     Publisher="CN=kaigu"
12
     Version="1.0.0.0" />
12
     Version="1.0.0.0" />
13
 
13
 

+ 5
- 4
example/windows/WebViewWindows/WebViewWindows.vcxproj Просмотреть файл

18
     <PackageCertificateKeyFile>WebViewWindows_TemporaryKey.pfx</PackageCertificateKeyFile>
18
     <PackageCertificateKeyFile>WebViewWindows_TemporaryKey.pfx</PackageCertificateKeyFile>
19
     <PackageCertificateThumbprint>82A0D300B0912A62746FFB3E6E04F88985BC2798</PackageCertificateThumbprint>
19
     <PackageCertificateThumbprint>82A0D300B0912A62746FFB3E6E04F88985BC2798</PackageCertificateThumbprint>
20
     <PackageCertificatePassword>password</PackageCertificatePassword>
20
     <PackageCertificatePassword>password</PackageCertificatePassword>
21
+    <AppxPackageSigningEnabled>true</AppxPackageSigningEnabled>
21
   </PropertyGroup>
22
   </PropertyGroup>
22
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
23
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
23
   <ItemGroup Label="ProjectConfigurations">
24
   <ItemGroup Label="ProjectConfigurations">
145
   <ItemGroup>
146
   <ItemGroup>
146
     <None Include="packages.config" />
147
     <None Include="packages.config" />
147
     <None Include="PropertySheet.props" />
148
     <None Include="PropertySheet.props" />
149
+    <None Include="WebViewWindows_TemporaryKey.pfx" />
148
     <Text Include="readme.txt">
150
     <Text Include="readme.txt">
149
       <DeploymentContent>false</DeploymentContent>
151
       <DeploymentContent>false</DeploymentContent>
150
     </Text>
152
     </Text>
159
   </ItemGroup>
161
   </ItemGroup>
160
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
162
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
161
   <PropertyGroup>
163
   <PropertyGroup>
162
-    <BundleCommand>
163
-      cd $(SolutionDir)..
164
-      react-native bundle --platform windows --entry-file example/index.js --bundle-output windows/$(SolutionName)/Bundle/index.windows.bundle --assets-dest windows/$(SolutionName)/Bundle
165
-    </BundleCommand>
164
+    <BundleEntryFile>example/index.js</BundleEntryFile>
165
+    <BundlerExtraArgs>--use-react-native-windows</BundlerExtraArgs>
166
   </PropertyGroup>
166
   </PropertyGroup>
167
   <Import Project="..\..\..\node_modules\react-native-windows\PropertySheets\Bundle.Cpp.targets" />
167
   <Import Project="..\..\..\node_modules\react-native-windows\PropertySheets\Bundle.Cpp.targets" />
168
+  <Import Project="..\..\..\node_modules\react-native-windows\PropertySheets\Bundle.props" />
168
   <ImportGroup Label="ExtensionTargets">
169
   <ImportGroup Label="ExtensionTargets">
169
     <Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
170
     <Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
170
     <Import Project="$(SolutionDir)packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets')" />
171
     <Import Project="$(SolutionDir)packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.UI.Xaml.2.3.191129002\build\native\Microsoft.UI.Xaml.targets')" />

+ 1
- 0
example/windows/WebViewWindows/WebViewWindows.vcxproj.filters Просмотреть файл

51
   <ItemGroup>
51
   <ItemGroup>
52
     <None Include="PropertySheet.props" />
52
     <None Include="PropertySheet.props" />
53
     <None Include="packages.config" />
53
     <None Include="packages.config" />
54
+    <None Include="WebViewWindows_TemporaryKey.pfx" />
54
   </ItemGroup>
55
   </ItemGroup>
55
   <ItemGroup>
56
   <ItemGroup>
56
     <Text Include="readme.txt" />
57
     <Text Include="readme.txt" />

+ 24
- 24
example/windows/WebViewWindows/pch.h Просмотреть файл

1
-#pragma once
2
-
3
-#define NOMINMAX
4
-#include <hstring.h>
5
-#include <restrictederrorinfo.h>
6
-#include <unknwn.h>
7
-#include <windows.h>
8
-#include <winrt/Windows.ApplicationModel.Activation.h>
9
-#include <winrt/Windows.Foundation.Collections.h>
10
-#include <winrt/Windows.Foundation.h>
11
-#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
12
-#include <winrt/Windows.UI.Xaml.Controls.h>
13
-#include <winrt/Windows.UI.Xaml.Data.h>
14
-#include <winrt/Windows.UI.Xaml.Interop.h>
15
-#include <winrt/Windows.UI.Xaml.Markup.h>
16
-#include <winrt/Windows.UI.Xaml.Navigation.h>
17
-#include <winrt/Windows.UI.Xaml.h>
18
-
19
-#include <winrt/Microsoft.ReactNative.h>
20
-
21
-#include <winrt/Microsoft.UI.Xaml.Automation.Peers.h>
22
-#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
23
-#include <winrt/Microsoft.UI.Xaml.Controls.h>
24
-#include <winrt/Microsoft.UI.Xaml.Media.h>
1
+#pragma once
2
+
3
+#define NOMINMAX
4
+#include <hstring.h>
5
+#include <restrictederrorinfo.h>
6
+#include <unknwn.h>
7
+#include <windows.h>
8
+#include <winrt/Windows.ApplicationModel.Activation.h>
9
+#include <winrt/Windows.Foundation.Collections.h>
10
+#include <winrt/Windows.Foundation.h>
11
+#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
12
+#include <winrt/Windows.UI.Xaml.Controls.h>
13
+#include <winrt/Windows.UI.Xaml.Data.h>
14
+#include <winrt/Windows.UI.Xaml.Interop.h>
15
+#include <winrt/Windows.UI.Xaml.Markup.h>
16
+#include <winrt/Windows.UI.Xaml.Navigation.h>
17
+#include <winrt/Windows.UI.Xaml.h>
18
+
19
+#include <winrt/Microsoft.ReactNative.h>
20
+
21
+#include <winrt/Microsoft.UI.Xaml.Automation.Peers.h>
22
+#include <winrt/Microsoft.UI.Xaml.Controls.Primitives.h>
23
+#include <winrt/Microsoft.UI.Xaml.Controls.h>
24
+#include <winrt/Microsoft.UI.Xaml.Media.h>
25
 #include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>
25
 #include <winrt/Microsoft.UI.Xaml.XamlTypeInfo.h>

+ 1
- 1
index.d.ts Просмотреть файл

2
 // eslint-disable-next-line
2
 // eslint-disable-next-line
3
 import { IOSWebViewProps, AndroidWebViewProps } from './lib/WebViewTypes';
3
 import { IOSWebViewProps, AndroidWebViewProps } from './lib/WebViewTypes';
4
 
4
 
5
-export { WebViewMessageEvent, WebViewNavigation } from "./lib/WebViewTypes";
5
+export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./lib/WebViewTypes";
6
 
6
 
7
 export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
7
 export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
8
 
8
 

+ 7
- 7
ios/RNCWebView.xcodeproj/project.pbxproj Просмотреть файл

26
 
26
 
27
 /* Begin PBXFileReference section */
27
 /* Begin PBXFileReference section */
28
 		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
28
 		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
29
-		3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNCWKProcessPoolManager.m; sourceTree = "<group>"; };
30
-		3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNCWKProcessPoolManager.h; sourceTree = "<group>"; };
31
-		E91B351921446E6C00F9801F /* RNCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWebViewManager.h; sourceTree = "<group>"; };
32
-		E91B351A21446E6C00F9801F /* RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNCWebView.h; sourceTree = "<group>"; };
33
-		E91B351B21446E6C00F9801F /* RNCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWebViewManager.m; sourceTree = "<group>"; };
34
-		E91B351C21446E6C00F9801F /* RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNCWebView.m; sourceTree = "<group>"; };
29
+		3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNCWKProcessPoolManager.m; path = ../apple/RNCWKProcessPoolManager.m; sourceTree = "<group>"; };
30
+		3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNCWKProcessPoolManager.h; path = ../apple/RNCWKProcessPoolManager.h; sourceTree = "<group>"; };
31
+		E91B351921446E6C00F9801F /* RNCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCWebViewManager.h; path = ../apple/RNCWebViewManager.h; sourceTree = "<group>"; };
32
+		E91B351A21446E6C00F9801F /* RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCWebView.h; path = ../apple/RNCWebView.h; sourceTree = "<group>"; };
33
+		E91B351B21446E6C00F9801F /* RNCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCWebViewManager.m; path = ../apple/RNCWebViewManager.m; sourceTree = "<group>"; };
34
+		E91B351C21446E6C00F9801F /* RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCWebView.m; path = ../apple/RNCWebView.m; sourceTree = "<group>"; };
35
 /* End PBXFileReference section */
35
 /* End PBXFileReference section */
36
 
36
 
37
 /* Begin PBXFrameworksBuildPhase section */
37
 /* Begin PBXFrameworksBuildPhase section */
60
 				E91B351C21446E6C00F9801F /* RNCWebView.m */,
60
 				E91B351C21446E6C00F9801F /* RNCWebView.m */,
61
 				E91B351921446E6C00F9801F /* RNCWebViewManager.h */,
61
 				E91B351921446E6C00F9801F /* RNCWebViewManager.h */,
62
 				E91B351B21446E6C00F9801F /* RNCWebViewManager.m */,
62
 				E91B351B21446E6C00F9801F /* RNCWebViewManager.m */,
63
-				3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */,
64
 				3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */,
63
 				3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */,
64
+				3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */,
65
 				134814211AA4EA7D00B7C361 /* Products */,
65
 				134814211AA4EA7D00B7C361 /* Products */,
66
 			);
66
 			);
67
 			sourceTree = "<group>";
67
 			sourceTree = "<group>";

+ 12
- 0
jest-setups/jest.setup.js Просмотреть файл

1
+import { windowsAppDriverCapabilities } from 'selenium-appium'
2
+
3
+switch (platform) {
4
+    case "windows":
5
+        const webViewWindowsAppId = 'WebViewWindows_3x6rhkkr9xcf6!App';
6
+        module.exports = {
7
+            capabilites: windowsAppDriverCapabilities(webViewWindowsAppId)
8
+        }
9
+        break;
10
+    default:
11
+        throw "Unknown platform: " + platform;
12
+}

+ 1
- 0
jest-setups/jest.setup.windows.js Просмотреть файл

1
+platform = "windows"

+ 24
- 24
macos/RNCWebView.xcodeproj/project.pbxproj Просмотреть файл

7
 	objects = {
7
 	objects = {
8
 
8
 
9
 /* Begin PBXBuildFile section */
9
 /* Begin PBXBuildFile section */
10
-		3515965E21A3C86000623BFA /* ../ios/RNCWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* ../ios/RNCWKProcessPoolManager.m */; };
11
-		38116A2B23BBECB700ACE311 /* ../ios/RNCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* ../ios/RNCWebViewManager.m */; };
12
-		38116A2C23BBECB700ACE311 /* ../ios/RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* ../ios/RNCWebView.m */; };
13
-		38116A2D23BBECB700ACE311 /* ../ios/RNCWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* ../ios/RNCWKProcessPoolManager.m */; };
14
-		E91B351D21446E6C00F9801F /* ../ios/RNCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* ../ios/RNCWebViewManager.m */; };
15
-		E91B351E21446E6C00F9801F /* ../ios/RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* ../ios/RNCWebView.m */; };
10
+		3515965E21A3C86000623BFA /* RNCWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */; };
11
+		38116A2B23BBECB700ACE311 /* RNCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RNCWebViewManager.m */; };
12
+		38116A2C23BBECB700ACE311 /* RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RNCWebView.m */; };
13
+		38116A2D23BBECB700ACE311 /* RNCWKProcessPoolManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */; };
14
+		E91B351D21446E6C00F9801F /* RNCWebViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351B21446E6C00F9801F /* RNCWebViewManager.m */; };
15
+		E91B351E21446E6C00F9801F /* RNCWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = E91B351C21446E6C00F9801F /* RNCWebView.m */; };
16
 /* End PBXBuildFile section */
16
 /* End PBXBuildFile section */
17
 
17
 
18
 /* Begin PBXCopyFilesBuildPhase section */
18
 /* Begin PBXCopyFilesBuildPhase section */
38
 
38
 
39
 /* Begin PBXFileReference section */
39
 /* Begin PBXFileReference section */
40
 		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
40
 		134814201AA4EA6300B7C361 /* libRNCWebView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNCWebView.a; sourceTree = BUILT_PRODUCTS_DIR; };
41
-		3515965D21A3C86000623BFA /* ../ios/RNCWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ../ios/RNCWKProcessPoolManager.m; sourceTree = "<group>"; };
42
-		3515965F21A3C87E00623BFA /* ../ios/RNCWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ../ios/RNCWKProcessPoolManager.h; sourceTree = "<group>"; };
41
+		3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNCWKProcessPoolManager.m; path = ../apple/RNCWKProcessPoolManager.m; sourceTree = "<group>"; };
42
+		3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNCWKProcessPoolManager.h; path = ../apple/RNCWKProcessPoolManager.h; sourceTree = "<group>"; };
43
 		38116A3323BBECB700ACE311 /* libRNCWebView-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRNCWebView-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
43
 		38116A3323BBECB700ACE311 /* libRNCWebView-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRNCWebView-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
44
-		E91B351921446E6C00F9801F /* ../ios/RNCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../ios/RNCWebViewManager.h; sourceTree = "<group>"; };
45
-		E91B351A21446E6C00F9801F /* ../ios/RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../ios/RNCWebView.h; sourceTree = "<group>"; };
46
-		E91B351B21446E6C00F9801F /* ../ios/RNCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ../ios/RNCWebViewManager.m; sourceTree = "<group>"; };
47
-		E91B351C21446E6C00F9801F /* ../ios/RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ../ios/RNCWebView.m; sourceTree = "<group>"; };
44
+		E91B351921446E6C00F9801F /* RNCWebViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCWebViewManager.h; path = ../apple/RNCWebViewManager.h; sourceTree = "<group>"; };
45
+		E91B351A21446E6C00F9801F /* RNCWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCWebView.h; path = ../apple/RNCWebView.h; sourceTree = "<group>"; };
46
+		E91B351B21446E6C00F9801F /* RNCWebViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCWebViewManager.m; path = ../apple/RNCWebViewManager.m; sourceTree = "<group>"; };
47
+		E91B351C21446E6C00F9801F /* RNCWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCWebView.m; path = ../apple/RNCWebView.m; sourceTree = "<group>"; };
48
 /* End PBXFileReference section */
48
 /* End PBXFileReference section */
49
 
49
 
50
 /* Begin PBXFrameworksBuildPhase section */
50
 /* Begin PBXFrameworksBuildPhase section */
76
 		58B511D21A9E6C8500147676 = {
76
 		58B511D21A9E6C8500147676 = {
77
 			isa = PBXGroup;
77
 			isa = PBXGroup;
78
 			children = (
78
 			children = (
79
-				E91B351A21446E6C00F9801F /* ../ios/RNCWebView.h */,
80
-				E91B351C21446E6C00F9801F /* ../ios/RNCWebView.m */,
81
-				E91B351921446E6C00F9801F /* ../ios/RNCWebViewManager.h */,
82
-				E91B351B21446E6C00F9801F /* ../ios/RNCWebViewManager.m */,
83
-				3515965D21A3C86000623BFA /* ../ios/RNCWKProcessPoolManager.m */,
84
-				3515965F21A3C87E00623BFA /* ../ios/RNCWKProcessPoolManager.h */,
79
+				E91B351A21446E6C00F9801F /* RNCWebView.h */,
80
+				E91B351C21446E6C00F9801F /* RNCWebView.m */,
81
+				E91B351921446E6C00F9801F /* RNCWebViewManager.h */,
82
+				E91B351B21446E6C00F9801F /* RNCWebViewManager.m */,
83
+				3515965F21A3C87E00623BFA /* RNCWKProcessPoolManager.h */,
84
+				3515965D21A3C86000623BFA /* RNCWKProcessPoolManager.m */,
85
 				134814211AA4EA7D00B7C361 /* Products */,
85
 				134814211AA4EA7D00B7C361 /* Products */,
86
 				38116A3323BBECB700ACE311 /* libRNCWebView-macOS.a */,
86
 				38116A3323BBECB700ACE311 /* libRNCWebView-macOS.a */,
87
 			);
87
 			);
161
 			isa = PBXSourcesBuildPhase;
161
 			isa = PBXSourcesBuildPhase;
162
 			buildActionMask = 2147483647;
162
 			buildActionMask = 2147483647;
163
 			files = (
163
 			files = (
164
-				38116A2B23BBECB700ACE311 /* ../ios/RNCWebViewManager.m in Sources */,
165
-				38116A2C23BBECB700ACE311 /* ../ios/RNCWebView.m in Sources */,
166
-				38116A2D23BBECB700ACE311 /* ../ios/RNCWKProcessPoolManager.m in Sources */,
164
+				38116A2B23BBECB700ACE311 /* RNCWebViewManager.m in Sources */,
165
+				38116A2C23BBECB700ACE311 /* RNCWebView.m in Sources */,
166
+				38116A2D23BBECB700ACE311 /* RNCWKProcessPoolManager.m in Sources */,
167
 			);
167
 			);
168
 			runOnlyForDeploymentPostprocessing = 0;
168
 			runOnlyForDeploymentPostprocessing = 0;
169
 		};
169
 		};
171
 			isa = PBXSourcesBuildPhase;
171
 			isa = PBXSourcesBuildPhase;
172
 			buildActionMask = 2147483647;
172
 			buildActionMask = 2147483647;
173
 			files = (
173
 			files = (
174
-				E91B351D21446E6C00F9801F /* ../ios/RNCWebViewManager.m in Sources */,
175
-				E91B351E21446E6C00F9801F /* ../ios/RNCWebView.m in Sources */,
176
-				3515965E21A3C86000623BFA /* ../ios/RNCWKProcessPoolManager.m in Sources */,
174
+				E91B351D21446E6C00F9801F /* RNCWebViewManager.m in Sources */,
175
+				E91B351E21446E6C00F9801F /* RNCWebView.m in Sources */,
176
+				3515965E21A3C86000623BFA /* RNCWKProcessPoolManager.m in Sources */,
177
 			);
177
 			);
178
 			runOnlyForDeploymentPostprocessing = 0;
178
 			runOnlyForDeploymentPostprocessing = 0;
179
 		};
179
 		};

+ 91
- 86
package.json Просмотреть файл

1
-{
2
-  "name": "react-native-webview",
3
-  "description": "React Native WebView component for iOS, Android, macOS, and Windows",
4
-  "main": "index.js",
5
-  "typings": "index.d.ts",
6
-  "author": "Jamon Holmgren <jamon@infinite.red>",
7
-  "contributors": [
8
-    "Thibault Malbranche <malbranche.thibault@gmail.com>"
9
-  ],
10
-  "license": "MIT",
11
-  "version": "9.0.2",
12
-  "homepage": "https://github.com/react-native-community/react-native-webview#readme",
13
-  "scripts": {
14
-    "start": "node node_modules/react-native/local-cli/cli.js start",
15
-    "start:android": "react-native run-android --root example/",
16
-    "start:ios": "react-native run-ios --project-path example/ios --scheme example",
17
-    "start:macos": "node node_modules/react-native-macos/local-cli/cli.js start --use-react-native-macos",
18
-    "start:windows": "react-native start --use-react-native-windows",
19
-    "ci": "CI=true && yarn lint && yarn test",
20
-    "ci:publish": "yarn semantic-release",
21
-    "lint": "yarn tsc --noEmit && yarn eslint ./src --ext .ts,.tsx",
22
-    "build": "yarn tsc",
23
-    "prepare": "yarn build",
24
-    "test": "yarn jest"
25
-  },
26
-  "rn-docs": {
27
-    "title": "Webview",
28
-    "type": "Component"
29
-  },
30
-  "peerDependencies": {
31
-    "react": "^16.9",
32
-    "react-native": ">=0.60 <0.62",
33
-    "react-native-windows": "^0.61.0-beta.58"
34
-  },
35
-  "dependencies": {
36
-    "escape-string-regexp": "2.0.0",
37
-    "invariant": "2.2.4",
38
-    "rnpm-plugin-windows": "^0.5.1-0"
39
-  },
40
-  "devDependencies": {
41
-    "@babel/core": "7.4.5",
42
-    "@babel/runtime": "7.4.5",
43
-    "@react-native-community/cli": "^3.2.0",
44
-    "@react-native-community/cli-platform-android": "^3.0.0",
45
-    "@react-native-community/cli-platform-ios": "^3.0.0",
46
-    "@semantic-release/git": "7.0.16",
47
-    "@types/invariant": "^2.2.30",
48
-    "@types/jest": "24.0.18",
49
-    "@types/react": "16.8.8",
50
-    "@types/react-native": "0.60.11",
51
-    "@typescript-eslint/eslint-plugin": "2.1.0",
52
-    "@typescript-eslint/parser": "2.1.0",
53
-    "babel-eslint": "10.0.3",
54
-    "babel-jest": "24.8.0",
55
-    "babel-plugin-module-resolver": "3.1.3",
56
-    "eslint": "6.3.0",
57
-    "eslint-config-airbnb": "18.0.1",
58
-    "eslint-config-prettier": "6.2.0",
59
-    "eslint-plugin-import": "2.18.2",
60
-    "eslint-plugin-jsx-a11y": "6.2.3",
61
-    "eslint-plugin-react": "7.14.3",
62
-    "eslint-plugin-react-native": "3.7.0",
63
-    "jest": "24.9.0",
64
-    "metro-react-native-babel-preset": "0.54.1",
65
-    "react": "16.9.0",
66
-    "react-native": "0.61.5",
67
-    "react-native-macos": "0.60.0-microsoft.49",
68
-    "react-native-windows": "^0.61.0-beta.58",
69
-    "semantic-release": "15.13.24",
70
-    "typescript": "3.6.2"
71
-  },
72
-  "repository": {
73
-    "type": "git",
74
-    "url": "https://github.com/react-native-community/react-native-webview.git"
75
-  },
76
-  "files": [
77
-    "android",
78
-    "ios",
79
-    "macos",
80
-    "windows",
81
-    "lib",
82
-    "index.js",
83
-    "index.d.ts",
84
-    "react-native-webview.podspec"
85
-  ]
86
-}
1
+{
2
+  "name": "react-native-webview",
3
+  "description": "React Native WebView component for iOS, Android, macOS, and Windows",
4
+  "main": "index.js",
5
+  "typings": "index.d.ts",
6
+  "author": "Jamon Holmgren <jamon@infinite.red>",
7
+  "contributors": [
8
+    "Thibault Malbranche <malbranche.thibault@gmail.com>"
9
+  ],
10
+  "license": "MIT",
11
+  "version": "10.3.3",
12
+  "homepage": "https://github.com/react-native-community/react-native-webview#readme",
13
+  "scripts": {
14
+    "start": "node node_modules/react-native/local-cli/cli.js start",
15
+    "start:android": "react-native run-android",
16
+    "start:ios": "react-native run-ios",
17
+    "start:macos": "node node_modules/react-native-macos/local-cli/cli.js start --use-react-native-macos",
18
+    "start:windows": "react-native start --use-react-native-windows",
19
+    "ci": "CI=true && yarn lint",
20
+    "ci:publish": "yarn semantic-release",
21
+    "lint": "yarn tsc --noEmit && yarn eslint ./src --ext .ts,.tsx",
22
+    "build": "yarn tsc",
23
+    "prepare": "yarn build",
24
+    "appium": "appium",
25
+    "test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.windows.js"
26
+  },
27
+  "rn-docs": {
28
+    "title": "Webview",
29
+    "type": "Component"
30
+  },
31
+  "peerDependencies": {
32
+    "react": "16.11.0",
33
+    "react-native": ">=0.60 <0.63"
34
+  },
35
+  "dependencies": {
36
+    "escape-string-regexp": "2.0.0",
37
+    "invariant": "2.2.4"
38
+  },
39
+  "devDependencies": {
40
+    "@babel/core": "7.4.5",
41
+    "@babel/runtime": "7.4.5",
42
+    "@react-native-community/cli": "^4.8.0",
43
+    "@react-native-community/cli-platform-android": "^4.8.0",
44
+    "@react-native-community/cli-platform-ios": "^4.8.0",
45
+    "@semantic-release/git": "7.0.16",
46
+    "@types/invariant": "^2.2.30",
47
+    "@types/jest": "24.0.18",
48
+    "@types/react": "16.9.34",
49
+    "@types/react-native": "0.62.5",
50
+    "@types/selenium-webdriver": "4.0.9",
51
+    "@typescript-eslint/eslint-plugin": "2.1.0",
52
+    "@typescript-eslint/parser": "2.1.0",
53
+    "babel-eslint": "10.0.3",
54
+    "babel-jest": "24.8.0",
55
+    "babel-plugin-module-resolver": "3.1.3",
56
+    "eslint": "6.3.0",
57
+    "eslint-config-airbnb": "18.0.1",
58
+    "eslint-config-prettier": "6.2.0",
59
+    "eslint-plugin-import": "2.18.2",
60
+    "eslint-plugin-jsx-a11y": "6.2.3",
61
+    "eslint-plugin-react": "7.14.3",
62
+    "eslint-plugin-react-native": "3.7.0",
63
+    "jest": "24.9.0",
64
+    "metro": "0.56.4",
65
+    "metro-react-native-babel-preset": "^0.59.0",
66
+    "react": "16.11.0",
67
+    "react-native": "0.62.2",
68
+    "react-native-macos": "0.60.0-microsoft.73",
69
+    "react-native-windows": "^0.62.0-0",
70
+    "semantic-release": "15.13.24",
71
+    "typescript": "3.8.3",
72
+    "appium": "1.17.0",
73
+    "selenium-appium": "0.0.15",
74
+    "selenium-webdriver": "4.0.0-alpha.7"
75
+  },
76
+  "repository": {
77
+    "type": "git",
78
+    "url": "https://github.com/react-native-community/react-native-webview.git"
79
+  },
80
+  "files": [
81
+    "android",
82
+    "apple",
83
+    "ios",
84
+    "macos",
85
+    "windows",
86
+    "lib",
87
+    "index.js",
88
+    "index.d.ts",
89
+    "react-native-webview.podspec"
90
+  ]
91
+}

+ 2
- 2
react-native-webview.podspec Просмотреть файл

10
 
10
 
11
   s.authors      = package['author']
11
   s.authors      = package['author']
12
   s.homepage     = package['homepage']
12
   s.homepage     = package['homepage']
13
-  s.platform     = :ios, "9.0"
13
+  s.platforms    = { :ios => "9.0", :osx => "10.14" }
14
 
14
 
15
   s.source       = { :git => "https://github.com/react-native-community/react-native-webview.git", :tag => "v#{s.version}" }
15
   s.source       = { :git => "https://github.com/react-native-community/react-native-webview.git", :tag => "v#{s.version}" }
16
-  s.source_files  = "ios/**/*.{h,m}"
16
+  s.source_files  = "apple/**/*.{h,m}"
17
 
17
 
18
   s.dependency 'React'
18
   s.dependency 'React'
19
 end
19
 end

+ 14
- 0
react-native.config.js Просмотреть файл

15
  */
15
  */
16
 'use strict';
16
 'use strict';
17
 
17
 
18
+const path = require('path');
19
+
18
 const macSwitch = '--use-react-native-macos';
20
 const macSwitch = '--use-react-native-macos';
19
 const windowsSwitch = '--use-react-native-windows';
21
 const windowsSwitch = '--use-react-native-windows';
20
 
22
 
31
   module.exports = {
33
   module.exports = {
32
     reactNativePath: 'node_modules/react-native-windows',
34
     reactNativePath: 'node_modules/react-native-windows',
33
   };
35
   };
36
+}
37
+else {
38
+  module.exports = {
39
+    project: {
40
+      ios: {
41
+        project: 'example/ios/',
42
+      },
43
+      android: {
44
+        sourceDir: 'example/android',
45
+      },
46
+    },
47
+  };
34
 }
48
 }

+ 15
- 0
src/WebView.android.tsx Просмотреть файл

10
   findNodeHandle,
10
   findNodeHandle,
11
 } from 'react-native';
11
 } from 'react-native';
12
 
12
 
13
+import BatchedBridge from 'react-native/Libraries/BatchedBridge/BatchedBridge';
14
+
13
 import invariant from 'invariant';
15
 import invariant from 'invariant';
14
 
16
 
15
 import {
17
 import {
39
 ) as typeof NativeWebViewAndroid;
41
 ) as typeof NativeWebViewAndroid;
40
 const { resolveAssetSource } = Image;
42
 const { resolveAssetSource } = Image;
41
 
43
 
44
+/**
45
+ * A simple counter to uniquely identify WebView instances. Do not use this for anything else.
46
+ */
47
+let uniqueRef = 0;
48
+
42
 /**
49
 /**
43
  * Renders a native WebView.
50
  * Renders a native WebView.
44
  */
51
  */
68
     lastErrorEvent: null,
75
     lastErrorEvent: null,
69
   };
76
   };
70
 
77
 
78
+
71
   webViewRef = React.createRef<NativeWebViewAndroid>();
79
   webViewRef = React.createRef<NativeWebViewAndroid>();
72
 
80
 
81
+  messagingModuleName = `WebViewMessageHandler${uniqueRef+=1}`;
82
+
83
+  componentDidMount = () => {
84
+    BatchedBridge.registerCallableModule(this.messagingModuleName, this);
85
+  };
86
+
73
   getCommands = () => UIManager.getViewManagerConfig('RNCWebView').Commands;
87
   getCommands = () => UIManager.getViewManagerConfig('RNCWebView').Commands;
74
 
88
 
75
   goForward = () => {
89
   goForward = () => {
327
         key="webViewKey"
341
         key="webViewKey"
328
         {...otherProps}
342
         {...otherProps}
329
         messagingEnabled={typeof onMessage === 'function'}
343
         messagingEnabled={typeof onMessage === 'function'}
344
+        messagingModuleName={this.messagingModuleName}
330
         onLoadingError={this.onLoadingError}
345
         onLoadingError={this.onLoadingError}
331
         onLoadingFinish={this.onLoadingFinish}
346
         onLoadingFinish={this.onLoadingFinish}
332
         onLoadingProgress={this.onLoadingProgress}
347
         onLoadingProgress={this.onLoadingProgress}

+ 1
- 0
src/WebView.ios.tsx Просмотреть файл

340
         onLoadingError={this.onLoadingError}
340
         onLoadingError={this.onLoadingError}
341
         onLoadingFinish={this.onLoadingFinish}
341
         onLoadingFinish={this.onLoadingFinish}
342
         onLoadingProgress={this.onLoadingProgress}
342
         onLoadingProgress={this.onLoadingProgress}
343
+        onFileDownload={this.props.onFileDownload}
343
         onLoadingStart={this.onLoadingStart}
344
         onLoadingStart={this.onLoadingStart}
344
         onHttpError={this.onHttpError}
345
         onHttpError={this.onHttpError}
345
         onMessage={this.onMessage}
346
         onMessage={this.onMessage}

+ 18
- 3
src/WebView.tsx Просмотреть файл

1
-// This files provides compatibility without tree platform.
2
-import { WebView } from 'react-native';
1
+import React from 'react';
2
+import { View } from 'react-native';
3
+import { IOSWebViewProps, AndroidWebViewProps } from './WebViewTypes';
4
+
5
+export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
6
+
7
+// This "dummy" WebView is to render something for unsupported platforms,
8
+// like for example Expo SDK "web" platform. It matches the previous react-native
9
+// implementation which is produced by Expo SDK 37.0.0.1 implementation, with
10
+// similar interface than the native ones have.
11
+const WebView: React.FunctionComponent<WebViewProps> = () => (
12
+	<View style={{
13
+		alignSelf: 'flex-start',
14
+		borderColor: 'rgb(255, 0, 0)',
15
+		borderWidth: 1
16
+	}} />
17
+);
3
 
18
 
4
 export { WebView };
19
 export { WebView };
5
-export default WebView;
20
+export default WebView;

+ 266
- 258
src/WebView.windows.tsx Просмотреть файл

1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * Portions copyright for react-native-windows:
8
- *
9
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
-
13
-import React from 'react';
14
-import {
15
-  UIManager as NotTypedUIManager,
16
-  View,
17
-  requireNativeComponent,
18
-  StyleSheet,
19
-  Image,
20
-  ImageSourcePropType,
21
-  findNodeHandle,
22
-} from 'react-native';
23
-import {
24
-  createOnShouldStartLoadWithRequest,
25
-} from './WebViewShared';
26
-import {
27
-  NativeWebViewWindows,
28
-  WebViewSharedProps,
29
-  WebViewProgressEvent,
30
-  WebViewNavigationEvent,
31
-  WebViewErrorEvent,
32
-  WebViewHttpErrorEvent,
33
-  WebViewMessageEvent,
34
-  RNCWebViewUIManagerWindows,
35
-  State,
36
-} from './WebViewTypes';
37
-
38
-const UIManager = NotTypedUIManager as RNCWebViewUIManagerWindows;
39
-const { resolveAssetSource } = Image;
40
-const RCTWebView: typeof NativeWebViewWindows = requireNativeComponent(
41
-  'RCTWebView',
42
-);
43
-
44
-const styles = StyleSheet.create({
45
-  container: {
46
-    flex: 1,
47
-  },
48
-  hidden: {
49
-    height: 0,
50
-    flex: 0, // disable 'flex:1' when hiding a View
51
-  },
52
-  loadingView: {
53
-    flex: 1,
54
-    justifyContent: 'center',
55
-    alignItems: 'center',
56
-  },
57
-  loadingProgressBar: {
58
-    height: 20,
59
-  },
60
-});
61
-
62
-export default class WebView extends React.Component<WebViewSharedProps, State> {
63
-
64
-  static defaultProps = {
65
-    javaScriptEnabled: true,
66
-  };
67
-
68
-  state: State = {
69
-    viewState: this.props.startInLoadingState ? 'LOADING' : 'IDLE',
70
-    lastErrorEvent: null,
71
-  }
72
-
73
-  webViewRef = React.createRef<NativeWebViewWindows>();
74
-
75
-  goForward = () => {
76
-    UIManager.dispatchViewManagerCommand(
77
-      this.getWebViewHandle(),
78
-      UIManager.getViewManagerConfig('RCTWebView').Commands.goForward,
79
-      undefined,
80
-    );
81
-  }
82
-
83
-  goBack = () => {
84
-    UIManager.dispatchViewManagerCommand(
85
-      this.getWebViewHandle(),
86
-      UIManager.getViewManagerConfig('RCTWebView').Commands.goBack,
87
-      undefined,
88
-    );
89
-  }
90
-
91
-  reload = () => {
92
-    UIManager.dispatchViewManagerCommand(
93
-      this.getWebViewHandle(),
94
-      UIManager.getViewManagerConfig('RCTWebView').Commands.reload,
95
-      undefined,
96
-    );
97
-  }
98
-
99
-  injectJavaScript = (data: string) => {
100
-    UIManager.dispatchViewManagerCommand(
101
-      this.getWebViewHandle(),
102
-      UIManager.getViewManagerConfig('RCTWebView').Commands.injectJavaScript,
103
-      [data],
104
-    );
105
-  }
106
-
107
-  /**
108
-   * We return an event with a bunch of fields including:
109
-   *  url, title, loading, canGoBack, canGoForward
110
-   */
111
-  updateNavigationState = (event: WebViewNavigationEvent) => {
112
-    if (this.props.onNavigationStateChange) {
113
-      this.props.onNavigationStateChange(event.nativeEvent);
114
-    }
115
-  }
116
-
117
-  getWebViewHandle = () => {
118
-    // eslint-disable-next-line react/no-string-refs
119
-    return findNodeHandle(this.webViewRef.current);
120
-  }
121
-
122
-  onLoadingStart = (event: WebViewNavigationEvent) => {
123
-    const { onLoadStart } = this.props;
124
-    if(onLoadStart) {
125
-      onLoadStart(event);
126
-    }
127
-    this.updateNavigationState(event);
128
-  }
129
-
130
-  onLoadingProgress = (event: WebViewProgressEvent) => {
131
-    const { onLoadProgress } = this.props;
132
-    if (onLoadProgress) {
133
-      onLoadProgress(event);
134
-    }
135
-  };
136
-
137
-  onLoadingError = (event: WebViewErrorEvent) => {
138
-    event.persist(); // persist this event because we need to store it
139
-    const {onError, onLoadEnd} = this.props;
140
-    if(onError) {
141
-      onError(event);
142
-    }
143
-    if(onLoadEnd) {
144
-      onLoadEnd(event);
145
-    }
146
-    console.error('Encountered an error loading page', event.nativeEvent);
147
-    this.setState({
148
-      lastErrorEvent: event.nativeEvent,
149
-      viewState: 'ERROR',
150
-    });
151
-  }
152
-
153
-  onLoadingFinish =(event: WebViewNavigationEvent) => {
154
-    const {onLoad, onLoadEnd} = this.props;
155
-    if(onLoad) {
156
-      onLoad(event);
157
-    }
158
-    if(onLoadEnd) {
159
-      onLoadEnd(event);
160
-    }
161
-    this.setState({
162
-      viewState: 'IDLE',
163
-    });
164
-    this.updateNavigationState(event);
165
-  }
166
-
167
-  onMessage = (event: WebViewMessageEvent) => {
168
-    const { onMessage } = this.props;
169
-    if (onMessage) {
170
-      onMessage(event);
171
-    }
172
-  }
173
-
174
-  onHttpError = (event: WebViewHttpErrorEvent) => {
175
-    const { onHttpError } = this.props;
176
-    if (onHttpError) {
177
-      onHttpError(event);
178
-    }
179
-  }
180
-
181
-  render () {
182
-    const {
183
-      nativeConfig = {},
184
-      onMessage,
185
-      onShouldStartLoadWithRequest: onShouldStartLoadWithRequestProp,
186
-      originWhitelist,
187
-      renderError,
188
-      renderLoading,
189
-      style,
190
-      containerStyle,
191
-      ...otherProps
192
-    } = this.props;
193
-
194
-    let otherView = null;
195
-
196
-    if (this.state.viewState === 'LOADING') {
197
-      otherView = this.props.renderLoading && this.props.renderLoading();
198
-    } else if (this.state.viewState === 'ERROR') {
199
-      const errorEvent = this.state.lastErrorEvent;
200
-      otherView = this.props.renderError
201
-        && this.props.renderError(
202
-          errorEvent.domain,
203
-          errorEvent.code,
204
-          errorEvent.description,
205
-        );
206
-    } else if (this.state.viewState !== 'IDLE') {
207
-      console.error('RCTWebView invalid state encountered: ', this.state.viewState);
208
-    }
209
-
210
-    const webViewStyles = [styles.container, this.props.style];
211
-    if (
212
-      this.state.viewState === 'LOADING'
213
-      || this.state.viewState === 'ERROR'
214
-    ) {
215
-      // if we're in either LOADING or ERROR states, don't show the webView
216
-      webViewStyles.push(styles.hidden);
217
-    }
218
-
219
-    const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
220
-      ()=>{},
221
-      // casting cause it's in the default props
222
-      originWhitelist as readonly string[],
223
-      onShouldStartLoadWithRequestProp,
224
-    );
225
-
226
-    const NativeWebView
227
-    = (nativeConfig.component as typeof NativeWebViewWindows | undefined)
228
-    || RCTWebView;
229
-
230
-    const webView = (
231
-      <NativeWebView
232
-        ref={this.webViewRef}
233
-        key="webViewKey"
234
-        {...otherProps}
235
-        messagingEnabled={typeof onMessage === 'function'}
236
-        onLoadingError={this.onLoadingError}
237
-        onLoadingFinish={this.onLoadingFinish}
238
-        onLoadingProgress={this.onLoadingProgress}
239
-        onLoadingStart={this.onLoadingStart}
240
-        onHttpError={this.onHttpError}
241
-        onMessage={this.onMessage}
242
-        onScroll={this.props.onScroll}
243
-        onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
244
-        source={resolveAssetSource(this.props.source as ImageSourcePropType)}
245
-        style={webViewStyles}
246
-        {...nativeConfig.props}
247
-      />
248
-    );
249
-
250
-    return (
251
-      <View style={styles.container}>
252
-        {webView}
253
-        {otherView}
254
-      </View>
255
-    );
256
-  }
257
-
258
-}
1
+/**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * Portions copyright for react-native-windows:
8
+ *
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+
13
+import React from 'react';
14
+import {
15
+  UIManager as NotTypedUIManager,
16
+  View,
17
+  requireNativeComponent,
18
+  StyleSheet,
19
+  Image,
20
+  ImageSourcePropType,
21
+  findNodeHandle,
22
+} from 'react-native';
23
+import {
24
+  createOnShouldStartLoadWithRequest,
25
+} from './WebViewShared';
26
+import {
27
+  NativeWebViewWindows,
28
+  WebViewSharedProps,
29
+  WebViewProgressEvent,
30
+  WebViewNavigationEvent,
31
+  WebViewErrorEvent,
32
+  WebViewHttpErrorEvent,
33
+  WebViewMessageEvent,
34
+  RNCWebViewUIManagerWindows,
35
+  State,
36
+} from './WebViewTypes';
37
+
38
+const UIManager = NotTypedUIManager as RNCWebViewUIManagerWindows;
39
+const { resolveAssetSource } = Image;
40
+const RCTWebView: typeof NativeWebViewWindows = requireNativeComponent(
41
+  'RCTWebView',
42
+);
43
+
44
+const styles = StyleSheet.create({
45
+  container: {
46
+    flex: 1,
47
+  },
48
+  hidden: {
49
+    height: 0,
50
+    flex: 0, // disable 'flex:1' when hiding a View
51
+  },
52
+  loadingView: {
53
+    flex: 1,
54
+    justifyContent: 'center',
55
+    alignItems: 'center',
56
+  },
57
+  loadingProgressBar: {
58
+    height: 20,
59
+  },
60
+});
61
+
62
+export default class WebView extends React.Component<WebViewSharedProps, State> {
63
+
64
+  static defaultProps = {
65
+    javaScriptEnabled: true,
66
+  };
67
+
68
+  state: State = {
69
+    viewState: this.props.startInLoadingState ? 'LOADING' : 'IDLE',
70
+    lastErrorEvent: null,
71
+  }
72
+
73
+  webViewRef = React.createRef<NativeWebViewWindows>();
74
+
75
+  goForward = () => {
76
+    UIManager.dispatchViewManagerCommand(
77
+      this.getWebViewHandle(),
78
+      UIManager.getViewManagerConfig('RCTWebView').Commands.goForward,
79
+      undefined,
80
+    );
81
+  }
82
+
83
+  goBack = () => {
84
+    UIManager.dispatchViewManagerCommand(
85
+      this.getWebViewHandle(),
86
+      UIManager.getViewManagerConfig('RCTWebView').Commands.goBack,
87
+      undefined,
88
+    );
89
+  }
90
+
91
+  reload = () => {
92
+    UIManager.dispatchViewManagerCommand(
93
+      this.getWebViewHandle(),
94
+      UIManager.getViewManagerConfig('RCTWebView').Commands.reload,
95
+      undefined,
96
+    );
97
+  }
98
+
99
+  injectJavaScript = (data: string) => {
100
+    UIManager.dispatchViewManagerCommand(
101
+      this.getWebViewHandle(),
102
+      UIManager.getViewManagerConfig('RCTWebView').Commands.injectJavaScript,
103
+      [data],
104
+    );
105
+  }
106
+
107
+  postMessage = (data: string) => {
108
+    UIManager.dispatchViewManagerCommand(
109
+      this.getWebViewHandle(),
110
+      UIManager.getViewManagerConfig('RCTWebView').Commands.postMessage,
111
+      [String(data)],
112
+    );
113
+  };
114
+
115
+  /**
116
+   * We return an event with a bunch of fields including:
117
+   *  url, title, loading, canGoBack, canGoForward
118
+   */
119
+  updateNavigationState = (event: WebViewNavigationEvent) => {
120
+    if (this.props.onNavigationStateChange) {
121
+      this.props.onNavigationStateChange(event.nativeEvent);
122
+    }
123
+  }
124
+
125
+  getWebViewHandle = () => {
126
+    // eslint-disable-next-line react/no-string-refs
127
+    return findNodeHandle(this.webViewRef.current);
128
+  }
129
+
130
+  onLoadingStart = (event: WebViewNavigationEvent) => {
131
+    const { onLoadStart } = this.props;
132
+    if(onLoadStart) {
133
+      onLoadStart(event);
134
+    }
135
+    this.updateNavigationState(event);
136
+  }
137
+
138
+  onLoadingProgress = (event: WebViewProgressEvent) => {
139
+    const { onLoadProgress } = this.props;
140
+    if (onLoadProgress) {
141
+      onLoadProgress(event);
142
+    }
143
+  };
144
+
145
+  onLoadingError = (event: WebViewErrorEvent) => {
146
+    event.persist(); // persist this event because we need to store it
147
+    const {onError, onLoadEnd} = this.props;
148
+    if(onError) {
149
+      onError(event);
150
+    }
151
+    if(onLoadEnd) {
152
+      onLoadEnd(event);
153
+    }
154
+    console.error('Encountered an error loading page', event.nativeEvent);
155
+    this.setState({
156
+      lastErrorEvent: event.nativeEvent,
157
+      viewState: 'ERROR',
158
+    });
159
+  }
160
+
161
+  onLoadingFinish =(event: WebViewNavigationEvent) => {
162
+    const {onLoad, onLoadEnd} = this.props;
163
+    if(onLoad) {
164
+      onLoad(event);
165
+    }
166
+    if(onLoadEnd) {
167
+      onLoadEnd(event);
168
+    }
169
+    this.setState({
170
+      viewState: 'IDLE',
171
+    });
172
+    this.updateNavigationState(event);
173
+  }
174
+
175
+  onMessage = (event: WebViewMessageEvent) => {
176
+    const { onMessage } = this.props;
177
+    if (onMessage) {
178
+      onMessage(event);
179
+    }
180
+  }
181
+
182
+  onHttpError = (event: WebViewHttpErrorEvent) => {
183
+    const { onHttpError } = this.props;
184
+    if (onHttpError) {
185
+      onHttpError(event);
186
+    }
187
+  }
188
+
189
+  render () {
190
+    const {
191
+      nativeConfig = {},
192
+      onMessage,
193
+      onShouldStartLoadWithRequest: onShouldStartLoadWithRequestProp,
194
+      originWhitelist,
195
+      renderError,
196
+      renderLoading,
197
+      style,
198
+      containerStyle,
199
+      ...otherProps
200
+    } = this.props;
201
+
202
+    let otherView = null;
203
+
204
+    if (this.state.viewState === 'LOADING') {
205
+      otherView = this.props.renderLoading && this.props.renderLoading();
206
+    } else if (this.state.viewState === 'ERROR') {
207
+      const errorEvent = this.state.lastErrorEvent;
208
+      otherView = this.props.renderError
209
+        && this.props.renderError(
210
+          errorEvent.domain,
211
+          errorEvent.code,
212
+          errorEvent.description,
213
+        );
214
+    } else if (this.state.viewState !== 'IDLE') {
215
+      console.error('RCTWebView invalid state encountered: ', this.state.viewState);
216
+    }
217
+
218
+    const webViewStyles = [styles.container, this.props.style];
219
+    if (
220
+      this.state.viewState === 'LOADING'
221
+      || this.state.viewState === 'ERROR'
222
+    ) {
223
+      // if we're in either LOADING or ERROR states, don't show the webView
224
+      webViewStyles.push(styles.hidden);
225
+    }
226
+
227
+    const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
228
+      ()=>{},
229
+      // casting cause it's in the default props
230
+      originWhitelist as readonly string[],
231
+      onShouldStartLoadWithRequestProp,
232
+    );
233
+
234
+    const NativeWebView
235
+    = (nativeConfig.component as typeof NativeWebViewWindows | undefined)
236
+    || RCTWebView;
237
+
238
+    const webView = (
239
+      <NativeWebView
240
+        ref={this.webViewRef}
241
+        key="webViewKey"
242
+        {...otherProps}
243
+        messagingEnabled={typeof onMessage === 'function'}
244
+        onLoadingError={this.onLoadingError}
245
+        onLoadingFinish={this.onLoadingFinish}
246
+        onLoadingProgress={this.onLoadingProgress}
247
+        onLoadingStart={this.onLoadingStart}
248
+        onHttpError={this.onHttpError}
249
+        onMessage={this.onMessage}
250
+        onScroll={this.props.onScroll}
251
+        onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
252
+        source={resolveAssetSource(this.props.source as ImageSourcePropType)}
253
+        style={webViewStyles}
254
+        {...nativeConfig.props}
255
+      />
256
+    );
257
+
258
+    return (
259
+      <View style={styles.container}>
260
+        {webView}
261
+        {otherView}
262
+      </View>
263
+    );
264
+  }
265
+
266
+}

+ 52
- 0
src/WebViewTypes.ts Просмотреть файл

113
   mainDocumentURL?: string;
113
   mainDocumentURL?: string;
114
 }
114
 }
115
 
115
 
116
+export interface FileDownload {
117
+  downloadUrl: string;
118
+}
119
+
116
 export type DecelerationRateConstant = 'normal' | 'fast';
120
 export type DecelerationRateConstant = 'normal' | 'fast';
117
 
121
 
118
 export interface WebViewMessage extends WebViewNativeEvent {
122
 export interface WebViewMessage extends WebViewNativeEvent {
141
 
145
 
142
 export type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
146
 export type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
143
 
147
 
148
+export type FileDownloadEvent = NativeSyntheticEvent<FileDownload>;
149
+
144
 export type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
150
 export type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
145
 
151
 
146
 export type WebViewErrorEvent = NativeSyntheticEvent<WebViewError>;
152
 export type WebViewErrorEvent = NativeSyntheticEvent<WebViewError>;
234
   incognito?: boolean;
240
   incognito?: boolean;
235
   injectedJavaScript?: string;
241
   injectedJavaScript?: string;
236
   injectedJavaScriptBeforeContentLoaded?: string;
242
   injectedJavaScriptBeforeContentLoaded?: string;
243
+  injectedJavaScriptForMainFrameOnly?: boolean;
244
+  injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
245
+  javaScriptCanOpenWindowsAutomatically?: boolean;
237
   mediaPlaybackRequiresUserAction?: boolean;
246
   mediaPlaybackRequiresUserAction?: boolean;
238
   messagingEnabled: boolean;
247
   messagingEnabled: boolean;
239
   onScroll?: (event: NativeScrollEvent) => void;
248
   onScroll?: (event: NativeScrollEvent) => void;
272
   saveFormDataDisabled?: boolean;
281
   saveFormDataDisabled?: boolean;
273
   textZoom?: number;
282
   textZoom?: number;
274
   thirdPartyCookiesEnabled?: boolean;
283
   thirdPartyCookiesEnabled?: boolean;
284
+  messagingModuleName?: string;
275
   readonly urlPrefixesForDefaultIntent?: string[];
285
   readonly urlPrefixesForDefaultIntent?: string[];
276
 }
286
 }
277
 
287
 
301
   onContentProcessDidTerminate?: (event: WebViewTerminatedEvent) => void;
311
   onContentProcessDidTerminate?: (event: WebViewTerminatedEvent) => void;
302
   injectedJavaScriptForMainFrameOnly?: boolean;
312
   injectedJavaScriptForMainFrameOnly?: boolean;
303
   injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
313
   injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
314
+  onFileDownload?: (event: FileDownloadEvent) => void;
304
 }
315
 }
305
 
316
 
306
 export interface MacOSNativeWebViewProps extends CommonNativeWebViewProps {
317
 export interface MacOSNativeWebViewProps extends CommonNativeWebViewProps {
511
    * @platform ios
522
    * @platform ios
512
   */
523
   */
513
   injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
524
   injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
525
+
526
+  /**
527
+   * Function that is invoked when the client needs to download a file.
528
+   *
529
+   * iOS 13+ only: If the webview navigates to a URL that results in an HTTP
530
+   * response with a Content-Disposition header 'attachment...', then
531
+   * this will be called.
532
+   *
533
+   * iOS 8+: If the MIME type indicates that the content is not renderable by the
534
+   * webview, that will also cause this to be called. On iOS versions before 13,
535
+   * this is the only condition that will cause this function to be called.
536
+   *
537
+   * The application will need to provide its own code to actually download
538
+   * the file.
539
+   *
540
+   * If not provided, the default is to let the webview try to render the file.
541
+   */
542
+  onFileDownload?: (event: FileDownloadEvent) => void;
514
 }
543
 }
515
 
544
 
516
 export interface MacOSWebViewProps extends WebViewSharedProps {
545
 export interface MacOSWebViewProps extends WebViewSharedProps {
795
    */
824
    */
796
   javaScriptEnabled?: boolean;
825
   javaScriptEnabled?: boolean;
797
 
826
 
827
+  /**
828
+   * A Boolean value indicating whether JavaScript can open windows without user interaction.
829
+   * The default value is `false`.
830
+   */
831
+  javaScriptCanOpenWindowsAutomatically?: boolean;
832
+
798
   /**
833
   /**
799
    * Stylesheet object to set the style of the container view.
834
    * Stylesheet object to set the style of the container view.
800
    */
835
    */
882
    */
917
    */
883
   injectedJavaScriptBeforeContentLoaded?: string;
918
   injectedJavaScriptBeforeContentLoaded?: string;
884
 
919
 
920
+  /**
921
+   * If `true` (default; mandatory for Android), loads the `injectedJavaScript` only into the main frame.
922
+   * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
923
+   */
924
+  injectedJavaScriptForMainFrameOnly?: boolean;
925
+
926
+  /**
927
+   * If `true` (default; mandatory for Android), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
928
+   * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
929
+   */
930
+  injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
931
+
885
   /**
932
   /**
886
    * Boolean value that determines whether a horizontal scroll indicator is
933
    * Boolean value that determines whether a horizontal scroll indicator is
887
    * shown in the `WebView`. The default value is `true`.
934
    * shown in the `WebView`. The default value is `true`.
926
    * Should caching be enabled. Default is true.
973
    * Should caching be enabled. Default is true.
927
    */
974
    */
928
   cacheEnabled?: boolean;
975
   cacheEnabled?: boolean;
976
+
977
+  /**
978
+   * Append to the existing user-agent. Overridden if `userAgent` is set.
979
+   */
980
+  applicationNameForUserAgent?: string;
929
 }
981
 }

+ 204
- 204
windows/ReactNativeWebView.sln Просмотреть файл

1
-
2
-Microsoft Visual Studio Solution File, Format Version 12.00
3
-# Visual Studio Version 16
4
-VisualStudioVersion = 16.0.29609.76
5
-MinimumVisualStudioVersion = 10.0.40219.1
6
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeWebView", "ReactNativeWebView\ReactNativeWebView.vcxproj", "{729D9AF8-CD9E-4427-9F6C-FB757E287729}"
7
-EndProject
8
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{6030669C-4F4D-4889-B38E-0299826D8C01}"
9
-EndProject
10
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\node_modules\react-native-windows\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}"
11
-EndProject
12
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\node_modules\react-native-windows\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}"
13
-EndProject
14
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\node_modules\react-native-windows\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}"
15
-EndProject
16
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Shared", "..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems", "{0CC28589-39E4-4288-B162-97B959F8B843}"
17
-EndProject
18
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Universal", "..\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj", "{A62D504A-16B8-41D2-9F19-E2E86019E5E4}"
19
-EndProject
20
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}"
21
-EndProject
22
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}"
23
-EndProject
24
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.ReactNative.SharedManaged", "..\node_modules\react-native-windows\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.shproj", "{67A1076F-7790-4203-86EA-4402CCB5E782}"
25
-EndProject
26
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}"
27
-EndProject
28
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactUWP", "..\node_modules\react-native-windows\ReactUWP\ReactUWP.vcxproj", "{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}"
29
-EndProject
30
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactWindowsCore", "..\node_modules\react-native-windows\ReactWindowsCore\ReactWindowsCore.vcxproj", "{11C084A3-A57C-4296-A679-CAC17B603144}"
31
-EndProject
32
-Global
33
-	GlobalSection(SharedMSBuildProjectFiles) = preSolution
34
-		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{0cc28589-39e4-4288-b162-97b959f8b843}*SharedItemsImports = 9
35
-		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4
36
-		..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4
37
-		..\node_modules\react-native-windows\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{67a1076f-7790-4203-86ea-4402ccb5e782}*SharedItemsImports = 13
38
-		..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{729d9af8-cd9e-4427-9f6c-fb757e287729}*SharedItemsImports = 4
39
-		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4
40
-		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9
41
-		..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
42
-		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
43
-		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
44
-		..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
45
-		..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
46
-	EndGlobalSection
47
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
48
-		Debug|ARM = Debug|ARM
49
-		Debug|ARM64 = Debug|ARM64
50
-		Debug|x64 = Debug|x64
51
-		Debug|x86 = Debug|x86
52
-		Release|ARM = Release|ARM
53
-		Release|ARM64 = Release|ARM64
54
-		Release|x64 = Release|x64
55
-		Release|x86 = Release|x86
56
-	EndGlobalSection
57
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
58
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|ARM.ActiveCfg = Debug|ARM
59
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|ARM.Build.0 = Debug|ARM
60
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|ARM64.ActiveCfg = Debug|Win32
61
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x64.ActiveCfg = Debug|x64
62
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x64.Build.0 = Debug|x64
63
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x86.ActiveCfg = Debug|Win32
64
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x86.Build.0 = Debug|Win32
65
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|ARM.ActiveCfg = Release|ARM
66
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|ARM.Build.0 = Release|ARM
67
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|ARM64.ActiveCfg = Release|Win32
68
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x64.ActiveCfg = Release|x64
69
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x64.Build.0 = Release|x64
70
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x86.ActiveCfg = Release|Win32
71
-		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x86.Build.0 = Release|Win32
72
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM.ActiveCfg = Debug|ARM
73
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM.Build.0 = Debug|ARM
74
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64
75
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64
76
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64
77
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64
78
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32
79
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32
80
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM.ActiveCfg = Release|ARM
81
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM.Build.0 = Release|ARM
82
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64
83
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64
84
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64
85
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64
86
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32
87
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32
88
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM.ActiveCfg = Debug|ARM
89
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM.Build.0 = Debug|ARM
90
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64
91
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64
92
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64
93
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64
94
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32
95
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32
96
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM.ActiveCfg = Release|ARM
97
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM.Build.0 = Release|ARM
98
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64
99
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64
100
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64
101
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64
102
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32
103
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32
104
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM.ActiveCfg = Debug|ARM
105
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM.Build.0 = Debug|ARM
106
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM64.ActiveCfg = Debug|ARM64
107
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM64.Build.0 = Debug|ARM64
108
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x64.ActiveCfg = Debug|x64
109
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x64.Build.0 = Debug|x64
110
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x86.ActiveCfg = Debug|Win32
111
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x86.Build.0 = Debug|Win32
112
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM.ActiveCfg = Release|ARM
113
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM.Build.0 = Release|ARM
114
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM64.ActiveCfg = Release|ARM64
115
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM64.Build.0 = Release|ARM64
116
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x64.ActiveCfg = Release|x64
117
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x64.Build.0 = Release|x64
118
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x86.ActiveCfg = Release|Win32
119
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x86.Build.0 = Release|Win32
120
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.ActiveCfg = Debug|ARM
121
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.Build.0 = Debug|ARM
122
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64
123
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64
124
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64
125
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64
126
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32
127
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32
128
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.ActiveCfg = Release|ARM
129
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.Build.0 = Release|ARM
130
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64
131
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64
132
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64
133
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64
134
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32
135
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32
136
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.ActiveCfg = Debug|ARM
137
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.Build.0 = Debug|ARM
138
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64
139
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64
140
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64
141
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64
142
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32
143
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32
144
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM.ActiveCfg = Release|ARM
145
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM.Build.0 = Release|ARM
146
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64
147
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64
148
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64
149
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64
150
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32
151
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32
152
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.ActiveCfg = Debug|ARM
153
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.Build.0 = Debug|ARM
154
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM64.ActiveCfg = Debug|ARM64
155
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM64.Build.0 = Debug|ARM64
156
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.ActiveCfg = Debug|x64
157
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.Build.0 = Debug|x64
158
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.ActiveCfg = Debug|Win32
159
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.Build.0 = Debug|Win32
160
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.ActiveCfg = Release|ARM
161
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.Build.0 = Release|ARM
162
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM64.ActiveCfg = Release|ARM64
163
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM64.Build.0 = Release|ARM64
164
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.ActiveCfg = Release|x64
165
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.Build.0 = Release|x64
166
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.ActiveCfg = Release|Win32
167
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.Build.0 = Release|Win32
168
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM.ActiveCfg = Debug|ARM
169
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM.Build.0 = Debug|ARM
170
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM64.ActiveCfg = Debug|ARM64
171
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM64.Build.0 = Debug|ARM64
172
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x64.ActiveCfg = Debug|x64
173
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x64.Build.0 = Debug|x64
174
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x86.ActiveCfg = Debug|Win32
175
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x86.Build.0 = Debug|Win32
176
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM.ActiveCfg = Release|ARM
177
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM.Build.0 = Release|ARM
178
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM64.ActiveCfg = Release|ARM64
179
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM64.Build.0 = Release|ARM64
180
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x64.ActiveCfg = Release|x64
181
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x64.Build.0 = Release|x64
182
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x86.ActiveCfg = Release|Win32
183
-		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x86.Build.0 = Release|Win32
184
-	EndGlobalSection
185
-	GlobalSection(SolutionProperties) = preSolution
186
-		HideSolutionNode = FALSE
187
-	EndGlobalSection
188
-	GlobalSection(NestedProjects) = preSolution
189
-		{C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {6030669C-4F4D-4889-B38E-0299826D8C01}
190
-		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {6030669C-4F4D-4889-B38E-0299826D8C01}
191
-		{A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {6030669C-4F4D-4889-B38E-0299826D8C01}
192
-		{0CC28589-39E4-4288-B162-97B959F8B843} = {6030669C-4F4D-4889-B38E-0299826D8C01}
193
-		{A62D504A-16B8-41D2-9F19-E2E86019E5E4} = {6030669C-4F4D-4889-B38E-0299826D8C01}
194
-		{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {6030669C-4F4D-4889-B38E-0299826D8C01}
195
-		{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {6030669C-4F4D-4889-B38E-0299826D8C01}
196
-		{67A1076F-7790-4203-86EA-4402CCB5E782} = {6030669C-4F4D-4889-B38E-0299826D8C01}
197
-		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {6030669C-4F4D-4889-B38E-0299826D8C01}
198
-		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B} = {6030669C-4F4D-4889-B38E-0299826D8C01}
199
-		{11C084A3-A57C-4296-A679-CAC17B603144} = {6030669C-4F4D-4889-B38E-0299826D8C01}
200
-	EndGlobalSection
201
-	GlobalSection(ExtensibilityGlobals) = postSolution
202
-		SolutionGuid = {D1E18B0A-0D27-4F39-8A8B-7E3D784A99FC}
203
-	EndGlobalSection
204
-EndGlobal
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio Version 16
4
+VisualStudioVersion = 16.0.29609.76
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactNativeWebView", "ReactNativeWebView\ReactNativeWebView.vcxproj", "{729D9AF8-CD9E-4427-9F6C-FB757E287729}"
7
+EndProject
8
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReactNative", "ReactNative", "{6030669C-4F4D-4889-B38E-0299826D8C01}"
9
+EndProject
10
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Chakra", "..\node_modules\react-native-windows\Chakra\Chakra.vcxitems", "{C38970C0-5FBF-4D69-90D8-CBAC225AE895}"
11
+EndProject
12
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\node_modules\react-native-windows\Common\Common.vcxproj", "{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}"
13
+EndProject
14
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Folly", "..\node_modules\react-native-windows\Folly\Folly.vcxproj", "{A990658C-CE31-4BCC-976F-0FC6B1AF693D}"
15
+EndProject
16
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Shared", "..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems", "{0CC28589-39E4-4288-B162-97B959F8B843}"
17
+EndProject
18
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JSI.Universal", "..\node_modules\react-native-windows\JSI\Universal\JSI.Universal.vcxproj", "{A62D504A-16B8-41D2-9F19-E2E86019E5E4}"
19
+EndProject
20
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative", "..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj", "{F7D32BD0-2749-483E-9A0D-1635EF7E3136}"
21
+EndProject
22
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ReactNative.Cxx", "..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems", "{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B}"
23
+EndProject
24
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.ReactNative.SharedManaged", "..\node_modules\react-native-windows\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.shproj", "{67A1076F-7790-4203-86EA-4402CCB5E782}"
25
+EndProject
26
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactCommon", "..\node_modules\react-native-windows\ReactCommon\ReactCommon.vcxproj", "{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}"
27
+EndProject
28
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactUWP", "..\node_modules\react-native-windows\ReactUWP\ReactUWP.vcxproj", "{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}"
29
+EndProject
30
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReactWindowsCore", "..\node_modules\react-native-windows\ReactWindowsCore\ReactWindowsCore.vcxproj", "{11C084A3-A57C-4296-A679-CAC17B603144}"
31
+EndProject
32
+Global
33
+	GlobalSection(SharedMSBuildProjectFiles) = preSolution
34
+		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{0cc28589-39e4-4288-b162-97b959f8b843}*SharedItemsImports = 9
35
+		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4
36
+		..\node_modules\react-native-windows\Shared\Shared.vcxitems*{2d5d43d9-cffc-4c40-b4cd-02efb4e2742b}*SharedItemsImports = 4
37
+		..\node_modules\react-native-windows\Microsoft.ReactNative.SharedManaged\Microsoft.ReactNative.SharedManaged.projitems*{67a1076f-7790-4203-86ea-4402ccb5e782}*SharedItemsImports = 13
38
+		..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{729d9af8-cd9e-4427-9f6c-fb757e287729}*SharedItemsImports = 4
39
+		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{a62d504a-16b8-41d2-9f19-e2e86019e5e4}*SharedItemsImports = 4
40
+		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{c38970c0-5fbf-4d69-90d8-cbac225ae895}*SharedItemsImports = 9
41
+		..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems*{da8b35b3-da00-4b02-bde6-6a397b3fd46b}*SharedItemsImports = 9
42
+		..\node_modules\react-native-windows\Chakra\Chakra.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
43
+		..\node_modules\react-native-windows\JSI\Shared\JSI.Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
44
+		..\node_modules\react-native-windows\Mso\Mso.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
45
+		..\node_modules\react-native-windows\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
46
+	EndGlobalSection
47
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
48
+		Debug|ARM = Debug|ARM
49
+		Debug|ARM64 = Debug|ARM64
50
+		Debug|x64 = Debug|x64
51
+		Debug|x86 = Debug|x86
52
+		Release|ARM = Release|ARM
53
+		Release|ARM64 = Release|ARM64
54
+		Release|x64 = Release|x64
55
+		Release|x86 = Release|x86
56
+	EndGlobalSection
57
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
58
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|ARM.ActiveCfg = Debug|ARM
59
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|ARM.Build.0 = Debug|ARM
60
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|ARM64.ActiveCfg = Debug|Win32
61
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x64.ActiveCfg = Debug|x64
62
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x64.Build.0 = Debug|x64
63
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x86.ActiveCfg = Debug|Win32
64
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Debug|x86.Build.0 = Debug|Win32
65
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|ARM.ActiveCfg = Release|ARM
66
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|ARM.Build.0 = Release|ARM
67
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|ARM64.ActiveCfg = Release|Win32
68
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x64.ActiveCfg = Release|x64
69
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x64.Build.0 = Release|x64
70
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x86.ActiveCfg = Release|Win32
71
+		{729D9AF8-CD9E-4427-9F6C-FB757E287729}.Release|x86.Build.0 = Release|Win32
72
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM.ActiveCfg = Debug|ARM
73
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM.Build.0 = Debug|ARM
74
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.ActiveCfg = Debug|ARM64
75
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|ARM64.Build.0 = Debug|ARM64
76
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.ActiveCfg = Debug|x64
77
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x64.Build.0 = Debug|x64
78
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.ActiveCfg = Debug|Win32
79
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Debug|x86.Build.0 = Debug|Win32
80
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM.ActiveCfg = Release|ARM
81
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM.Build.0 = Release|ARM
82
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.ActiveCfg = Release|ARM64
83
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|ARM64.Build.0 = Release|ARM64
84
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.ActiveCfg = Release|x64
85
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x64.Build.0 = Release|x64
86
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.ActiveCfg = Release|Win32
87
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D}.Release|x86.Build.0 = Release|Win32
88
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM.ActiveCfg = Debug|ARM
89
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM.Build.0 = Debug|ARM
90
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.ActiveCfg = Debug|ARM64
91
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|ARM64.Build.0 = Debug|ARM64
92
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.ActiveCfg = Debug|x64
93
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x64.Build.0 = Debug|x64
94
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.ActiveCfg = Debug|Win32
95
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Debug|x86.Build.0 = Debug|Win32
96
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM.ActiveCfg = Release|ARM
97
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM.Build.0 = Release|ARM
98
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.ActiveCfg = Release|ARM64
99
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|ARM64.Build.0 = Release|ARM64
100
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.ActiveCfg = Release|x64
101
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x64.Build.0 = Release|x64
102
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.ActiveCfg = Release|Win32
103
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D}.Release|x86.Build.0 = Release|Win32
104
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM.ActiveCfg = Debug|ARM
105
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM.Build.0 = Debug|ARM
106
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM64.ActiveCfg = Debug|ARM64
107
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|ARM64.Build.0 = Debug|ARM64
108
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x64.ActiveCfg = Debug|x64
109
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x64.Build.0 = Debug|x64
110
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x86.ActiveCfg = Debug|Win32
111
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Debug|x86.Build.0 = Debug|Win32
112
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM.ActiveCfg = Release|ARM
113
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM.Build.0 = Release|ARM
114
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM64.ActiveCfg = Release|ARM64
115
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|ARM64.Build.0 = Release|ARM64
116
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x64.ActiveCfg = Release|x64
117
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x64.Build.0 = Release|x64
118
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x86.ActiveCfg = Release|Win32
119
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4}.Release|x86.Build.0 = Release|Win32
120
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.ActiveCfg = Debug|ARM
121
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM.Build.0 = Debug|ARM
122
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.ActiveCfg = Debug|ARM64
123
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|ARM64.Build.0 = Debug|ARM64
124
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.ActiveCfg = Debug|x64
125
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x64.Build.0 = Debug|x64
126
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.ActiveCfg = Debug|Win32
127
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Debug|x86.Build.0 = Debug|Win32
128
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.ActiveCfg = Release|ARM
129
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM.Build.0 = Release|ARM
130
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.ActiveCfg = Release|ARM64
131
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|ARM64.Build.0 = Release|ARM64
132
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.ActiveCfg = Release|x64
133
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x64.Build.0 = Release|x64
134
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.ActiveCfg = Release|Win32
135
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136}.Release|x86.Build.0 = Release|Win32
136
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.ActiveCfg = Debug|ARM
137
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM.Build.0 = Debug|ARM
138
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.ActiveCfg = Debug|ARM64
139
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|ARM64.Build.0 = Debug|ARM64
140
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.ActiveCfg = Debug|x64
141
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x64.Build.0 = Debug|x64
142
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.ActiveCfg = Debug|Win32
143
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Debug|x86.Build.0 = Debug|Win32
144
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM.ActiveCfg = Release|ARM
145
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM.Build.0 = Release|ARM
146
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.ActiveCfg = Release|ARM64
147
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|ARM64.Build.0 = Release|ARM64
148
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.ActiveCfg = Release|x64
149
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x64.Build.0 = Release|x64
150
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.ActiveCfg = Release|Win32
151
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD}.Release|x86.Build.0 = Release|Win32
152
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.ActiveCfg = Debug|ARM
153
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM.Build.0 = Debug|ARM
154
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM64.ActiveCfg = Debug|ARM64
155
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|ARM64.Build.0 = Debug|ARM64
156
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.ActiveCfg = Debug|x64
157
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x64.Build.0 = Debug|x64
158
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.ActiveCfg = Debug|Win32
159
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Debug|x86.Build.0 = Debug|Win32
160
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.ActiveCfg = Release|ARM
161
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM.Build.0 = Release|ARM
162
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM64.ActiveCfg = Release|ARM64
163
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|ARM64.Build.0 = Release|ARM64
164
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.ActiveCfg = Release|x64
165
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x64.Build.0 = Release|x64
166
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.ActiveCfg = Release|Win32
167
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B}.Release|x86.Build.0 = Release|Win32
168
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM.ActiveCfg = Debug|ARM
169
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM.Build.0 = Debug|ARM
170
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM64.ActiveCfg = Debug|ARM64
171
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|ARM64.Build.0 = Debug|ARM64
172
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x64.ActiveCfg = Debug|x64
173
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x64.Build.0 = Debug|x64
174
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x86.ActiveCfg = Debug|Win32
175
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Debug|x86.Build.0 = Debug|Win32
176
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM.ActiveCfg = Release|ARM
177
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM.Build.0 = Release|ARM
178
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM64.ActiveCfg = Release|ARM64
179
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|ARM64.Build.0 = Release|ARM64
180
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x64.ActiveCfg = Release|x64
181
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x64.Build.0 = Release|x64
182
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x86.ActiveCfg = Release|Win32
183
+		{11C084A3-A57C-4296-A679-CAC17B603144}.Release|x86.Build.0 = Release|Win32
184
+	EndGlobalSection
185
+	GlobalSection(SolutionProperties) = preSolution
186
+		HideSolutionNode = FALSE
187
+	EndGlobalSection
188
+	GlobalSection(NestedProjects) = preSolution
189
+		{C38970C0-5FBF-4D69-90D8-CBAC225AE895} = {6030669C-4F4D-4889-B38E-0299826D8C01}
190
+		{FCA38F3C-7C73-4C47-BE4E-32F77FA8538D} = {6030669C-4F4D-4889-B38E-0299826D8C01}
191
+		{A990658C-CE31-4BCC-976F-0FC6B1AF693D} = {6030669C-4F4D-4889-B38E-0299826D8C01}
192
+		{0CC28589-39E4-4288-B162-97B959F8B843} = {6030669C-4F4D-4889-B38E-0299826D8C01}
193
+		{A62D504A-16B8-41D2-9F19-E2E86019E5E4} = {6030669C-4F4D-4889-B38E-0299826D8C01}
194
+		{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {6030669C-4F4D-4889-B38E-0299826D8C01}
195
+		{DA8B35B3-DA00-4B02-BDE6-6A397B3FD46B} = {6030669C-4F4D-4889-B38E-0299826D8C01}
196
+		{67A1076F-7790-4203-86EA-4402CCB5E782} = {6030669C-4F4D-4889-B38E-0299826D8C01}
197
+		{A9D95A91-4DB7-4F72-BEB6-FE8A5C89BFBD} = {6030669C-4F4D-4889-B38E-0299826D8C01}
198
+		{2D5D43D9-CFFC-4C40-B4CD-02EFB4E2742B} = {6030669C-4F4D-4889-B38E-0299826D8C01}
199
+		{11C084A3-A57C-4296-A679-CAC17B603144} = {6030669C-4F4D-4889-B38E-0299826D8C01}
200
+	EndGlobalSection
201
+	GlobalSection(ExtensibilityGlobals) = postSolution
202
+		SolutionGuid = {D1E18B0A-0D27-4F39-8A8B-7E3D784A99FC}
203
+	EndGlobalSection
204
+EndGlobal

+ 15
- 15
windows/ReactNativeWebView/PropertySheet.props Просмотреть файл

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
-  <ImportGroup Label="PropertySheets" />
4
-  <PropertyGroup Label="UserMacros" />
5
-  <!--
6
-    To customize common C++/WinRT project properties: 
7
-    * right-click the project node
8
-    * expand the Common Properties item
9
-    * select the C++/WinRT property page
10
-
11
-    For more advanced scenarios, and complete documentation, please see:
12
-    https://github.com/Microsoft/cppwinrt/tree/master/nuget 
13
-    -->
14
-  <PropertyGroup />
15
-  <ItemDefinitionGroup />
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <ImportGroup Label="PropertySheets" />
4
+  <PropertyGroup Label="UserMacros" />
5
+  <!--
6
+    To customize common C++/WinRT project properties: 
7
+    * right-click the project node
8
+    * expand the Common Properties item
9
+    * select the C++/WinRT property page
10
+
11
+    For more advanced scenarios, and complete documentation, please see:
12
+    https://github.com/Microsoft/cppwinrt/tree/master/nuget 
13
+    -->
14
+  <PropertyGroup />
15
+  <ItemDefinitionGroup />
16
 </Project>
16
 </Project>

+ 3
- 3
windows/ReactNativeWebView/ReactNativeWebView.def Просмотреть файл

1
-EXPORTS
2
-DllCanUnloadNow = WINRT_CanUnloadNow                    PRIVATE
3
-DllGetActivationFactory = WINRT_GetActivationFactory    PRIVATE
1
+EXPORTS
2
+DllCanUnloadNow = WINRT_CanUnloadNow                    PRIVATE
3
+DllGetActivationFactory = WINRT_GetActivationFactory    PRIVATE

+ 32
- 32
windows/ReactNativeWebView/ReactNativeWebView.filters Просмотреть файл

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
-  <ItemGroup>
4
-    <Filter Include="Resources">
5
-      <UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7
-    </Filter>
8
-    <Filter Include="Generated Files">
9
-      <UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
10
-    </Filter>
11
-  </ItemGroup>
12
-  <ItemGroup>
13
-    <ClCompile Include="pch.cpp" />
14
-    <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
15
-    <ClCompile Include="ReactPackageProvider.cpp" />
16
-    <ClCompile Include="WebViewManager.cpp" />
17
-  </ItemGroup>
18
-  <ItemGroup>
19
-    <ClInclude Include="pch.h" />
20
-    <ClInclude Include="ReactPackageProvider.h" />
21
-    <ClInclude Include="WebViewManager.h" />
22
-  </ItemGroup>
23
-  <ItemGroup>
24
-    <None Include="ReactNativeWebView.def" />
25
-    <None Include="packages.config" />
26
-  </ItemGroup>
27
-  <ItemGroup>
28
-    <None Include="PropertySheet.props" />
29
-  </ItemGroup>
30
-  <ItemGroup>
31
-    <Midl Include="ReactPackageProvider.idl" />
32
-  </ItemGroup>
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <ItemGroup>
4
+    <Filter Include="Resources">
5
+      <UniqueIdentifier>accd3aa8-1ba0-4223-9bbe-0c431709210b</UniqueIdentifier>
6
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms</Extensions>
7
+    </Filter>
8
+    <Filter Include="Generated Files">
9
+      <UniqueIdentifier>{926ab91d-31b4-48c3-b9a4-e681349f27f0}</UniqueIdentifier>
10
+    </Filter>
11
+  </ItemGroup>
12
+  <ItemGroup>
13
+    <ClCompile Include="pch.cpp" />
14
+    <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
15
+    <ClCompile Include="ReactPackageProvider.cpp" />
16
+    <ClCompile Include="WebViewManager.cpp" />
17
+  </ItemGroup>
18
+  <ItemGroup>
19
+    <ClInclude Include="pch.h" />
20
+    <ClInclude Include="ReactPackageProvider.h" />
21
+    <ClInclude Include="WebViewManager.h" />
22
+  </ItemGroup>
23
+  <ItemGroup>
24
+    <None Include="ReactNativeWebView.def" />
25
+    <None Include="packages.config" />
26
+  </ItemGroup>
27
+  <ItemGroup>
28
+    <None Include="PropertySheet.props" />
29
+  </ItemGroup>
30
+  <ItemGroup>
31
+    <Midl Include="ReactPackageProvider.idl" />
32
+  </ItemGroup>
33
 </Project>
33
 </Project>

+ 159
- 161
windows/ReactNativeWebView/ReactNativeWebView.vcxproj Просмотреть файл

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
-  <Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props')" />
4
-  <PropertyGroup Label="Globals">
5
-    <CppWinRTOptimized>true</CppWinRTOptimized>
6
-    <CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
7
-    <MinimalCoreWin>true</MinimalCoreWin>
8
-    <ProjectGuid>{729d9af8-cd9e-4427-9f6c-fb757e287729}</ProjectGuid>
9
-    <ProjectName>ReactNativeWebView</ProjectName>
10
-    <RootNamespace>ReactNativeWebView</RootNamespace>
11
-    <DefaultLanguage>en-US</DefaultLanguage>
12
-    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
13
-    <AppContainerApplication>true</AppContainerApplication>
14
-    <ApplicationType>Windows Store</ApplicationType>
15
-    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
16
-    <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
17
-    <WindowsTargetPlatformMinVersion>10.0.15063.0</WindowsTargetPlatformMinVersion>
18
-  </PropertyGroup>
19
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
20
-  <ItemGroup Label="ProjectConfigurations">
21
-    <ProjectConfiguration Include="Debug|ARM">
22
-      <Configuration>Debug</Configuration>
23
-      <Platform>ARM</Platform>
24
-    </ProjectConfiguration>
25
-    <ProjectConfiguration Include="Debug|Win32">
26
-      <Configuration>Debug</Configuration>
27
-      <Platform>Win32</Platform>
28
-    </ProjectConfiguration>
29
-    <ProjectConfiguration Include="Debug|x64">
30
-      <Configuration>Debug</Configuration>
31
-      <Platform>x64</Platform>
32
-    </ProjectConfiguration>
33
-    <ProjectConfiguration Include="Release|ARM">
34
-      <Configuration>Release</Configuration>
35
-      <Platform>ARM</Platform>
36
-    </ProjectConfiguration>
37
-    <ProjectConfiguration Include="Release|Win32">
38
-      <Configuration>Release</Configuration>
39
-      <Platform>Win32</Platform>
40
-    </ProjectConfiguration>
41
-    <ProjectConfiguration Include="Release|x64">
42
-      <Configuration>Release</Configuration>
43
-      <Platform>x64</Platform>
44
-    </ProjectConfiguration>
45
-  </ItemGroup>
46
-  <PropertyGroup Label="Configuration">
47
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
48
-    <PlatformToolset>v140</PlatformToolset>
49
-    <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
50
-    <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
51
-    <CharacterSet>Unicode</CharacterSet>
52
-    <GenerateManifest>false</GenerateManifest>
53
-  </PropertyGroup>
54
-  <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
55
-    <UseDebugLibraries>true</UseDebugLibraries>
56
-    <LinkIncremental>true</LinkIncremental>
57
-  </PropertyGroup>
58
-  <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
59
-    <UseDebugLibraries>false</UseDebugLibraries>
60
-    <WholeProgramOptimization>true</WholeProgramOptimization>
61
-    <LinkIncremental>false</LinkIncremental>
62
-  </PropertyGroup>
63
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
64
-  <ImportGroup Label="ExtensionSettings">
65
-  </ImportGroup>
66
-  <ImportGroup Label="Shared">
67
-    <Import Project="..\..\..\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" Condition="Exists('..\..\..\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems')" />
68
-    <Import Project="..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" Condition="Exists('..\..\node_modules\react-native-windows\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems')"/>
69
-  </ImportGroup>
70
-  <ImportGroup Label="PropertySheets">
71
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
72
-  </ImportGroup>
73
-  <ImportGroup Label="PropertySheets">
74
-    <Import Project="PropertySheet.props" />
75
-  </ImportGroup>
76
-  <PropertyGroup Label="UserMacros" />
77
-  <PropertyGroup />
78
-  <ItemDefinitionGroup>
79
-    <ClCompile>
80
-      <PrecompiledHeader>Use</PrecompiledHeader>
81
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
82
-      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
83
-      <WarningLevel>Level4</WarningLevel>
84
-      <AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
85
-      <!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
86
-      <AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
87
-      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
88
-      <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
89
-      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
90
-    </ClCompile>
91
-    <Link>
92
-      <SubSystem>Console</SubSystem>
93
-      <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
94
-      <ModuleDefinitionFile>ReactNativeWebView.def</ModuleDefinitionFile>
95
-    </Link>
96
-  </ItemDefinitionGroup>
97
-  <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
98
-    <ClCompile>
99
-      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
100
-    </ClCompile>
101
-  </ItemDefinitionGroup>
102
-  <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
103
-    <ClCompile>
104
-      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
105
-    </ClCompile>
106
-  </ItemDefinitionGroup>
107
-  <ItemGroup>
108
-    <ClInclude Include="ReactWebView.h">
109
-      <DependentUpon>ReactWebView.idl</DependentUpon>
110
-    </ClInclude>
111
-    <ClInclude Include="ReactWebViewManager.h" />
112
-    <ClInclude Include="pch.h" />
113
-    <ClInclude Include="ReactPackageProvider.h">
114
-      <DependentUpon>ReactPackageProvider.idl</DependentUpon>
115
-    </ClInclude>
116
-  </ItemGroup>
117
-  <ItemGroup>
118
-    <ClCompile Include="ReactWebView.cpp">
119
-      <DependentUpon>ReactWebView.idl</DependentUpon>
120
-    </ClCompile>
121
-    <ClCompile Include="ReactWebViewManager.cpp" />
122
-    <ClCompile Include="pch.cpp">
123
-      <PrecompiledHeader>Create</PrecompiledHeader>
124
-    </ClCompile>
125
-    <ClCompile Include="ReactPackageProvider.cpp">
126
-      <DependentUpon>ReactPackageProvider.idl</DependentUpon>
127
-    </ClCompile>
128
-    <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
129
-  </ItemGroup>
130
-  <ItemGroup>
131
-    <Midl Include="ReactWebView.idl" />
132
-    <Midl Include="ReactPackageProvider.idl" />
133
-  </ItemGroup>
134
-  <ItemGroup>
135
-    <None Include="packages.config" />
136
-    <None Include="ReactNativeWebView.def" />
137
-  </ItemGroup>
138
-  <ItemGroup>
139
-    <None Include="PropertySheet.props" />
140
-  </ItemGroup>
141
-  <ItemGroup>
142
-    <ProjectReference Include="..\..\..\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj" Condition="Exists('..\..\..\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj')">
143
-      <Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
144
-      <Private>false</Private>
145
-    </ProjectReference>
146
-    <ProjectReference Include="..\..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj" Condition="Exists('..\..\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj')">
147
-      <Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
148
-      <Private>false</Private>
149
-    </ProjectReference>
150
-  </ItemGroup>
151
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
152
-  <ImportGroup Label="ExtensionTargets">
153
-    <Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
154
-  </ImportGroup>
155
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
156
-    <PropertyGroup>
157
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
158
-    </PropertyGroup>
159
-    <Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
160
-    <Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
161
-  </Target>
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+  <Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props')" />
4
+  <PropertyGroup Label="Globals">
5
+    <CppWinRTOptimized>true</CppWinRTOptimized>
6
+    <CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
7
+    <MinimalCoreWin>true</MinimalCoreWin>
8
+    <ProjectGuid>{729d9af8-cd9e-4427-9f6c-fb757e287729}</ProjectGuid>
9
+    <ProjectName>ReactNativeWebView</ProjectName>
10
+    <RootNamespace>ReactNativeWebView</RootNamespace>
11
+    <DefaultLanguage>en-US</DefaultLanguage>
12
+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
13
+    <AppContainerApplication>true</AppContainerApplication>
14
+    <ApplicationType>Windows Store</ApplicationType>
15
+    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
16
+    <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
17
+    <WindowsTargetPlatformMinVersion>10.0.15063.0</WindowsTargetPlatformMinVersion>
18
+  </PropertyGroup>
19
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
20
+  <ItemGroup Label="ProjectConfigurations">
21
+    <ProjectConfiguration Include="Debug|ARM">
22
+      <Configuration>Debug</Configuration>
23
+      <Platform>ARM</Platform>
24
+    </ProjectConfiguration>
25
+    <ProjectConfiguration Include="Debug|Win32">
26
+      <Configuration>Debug</Configuration>
27
+      <Platform>Win32</Platform>
28
+    </ProjectConfiguration>
29
+    <ProjectConfiguration Include="Debug|x64">
30
+      <Configuration>Debug</Configuration>
31
+      <Platform>x64</Platform>
32
+    </ProjectConfiguration>
33
+    <ProjectConfiguration Include="Release|ARM">
34
+      <Configuration>Release</Configuration>
35
+      <Platform>ARM</Platform>
36
+    </ProjectConfiguration>
37
+    <ProjectConfiguration Include="Release|Win32">
38
+      <Configuration>Release</Configuration>
39
+      <Platform>Win32</Platform>
40
+    </ProjectConfiguration>
41
+    <ProjectConfiguration Include="Release|x64">
42
+      <Configuration>Release</Configuration>
43
+      <Platform>x64</Platform>
44
+    </ProjectConfiguration>
45
+  </ItemGroup>
46
+  <PropertyGroup Label="Configuration">
47
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
48
+    <PlatformToolset>v140</PlatformToolset>
49
+    <PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
50
+    <PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
51
+    <CharacterSet>Unicode</CharacterSet>
52
+    <GenerateManifest>false</GenerateManifest>
53
+  </PropertyGroup>
54
+  <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
55
+    <UseDebugLibraries>true</UseDebugLibraries>
56
+    <LinkIncremental>true</LinkIncremental>
57
+  </PropertyGroup>
58
+  <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
59
+    <UseDebugLibraries>false</UseDebugLibraries>
60
+    <WholeProgramOptimization>true</WholeProgramOptimization>
61
+    <LinkIncremental>false</LinkIncremental>
62
+  </PropertyGroup>
63
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
64
+  <ImportGroup Label="ExtensionSettings">
65
+  </ImportGroup>
66
+  <PropertyGroup>
67
+    <ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
68
+  </PropertyGroup>
69
+  <ImportGroup Label="Shared">
70
+    <Import Project="$(ReactNativeWindowsDir)\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" />
71
+  </ImportGroup>
72
+  <ImportGroup Label="PropertySheets">
73
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74
+  </ImportGroup>
75
+  <ImportGroup Label="PropertySheets">
76
+    <Import Project="PropertySheet.props" />
77
+  </ImportGroup>
78
+  <PropertyGroup Label="UserMacros" />
79
+  <PropertyGroup />
80
+  <ItemDefinitionGroup>
81
+    <ClCompile>
82
+      <PrecompiledHeader>Use</PrecompiledHeader>
83
+      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
84
+      <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
85
+      <WarningLevel>Level4</WarningLevel>
86
+      <AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
87
+      <!--Temporarily disable cppwinrt heap enforcement to work around xaml compiler generated std::shared_ptr use -->
88
+      <AdditionalOptions Condition="'$(CppWinRTHeapEnforcement)'==''">/DWINRT_NO_MAKE_DETECTION %(AdditionalOptions)</AdditionalOptions>
89
+      <DisableSpecificWarnings>28204</DisableSpecificWarnings>
90
+      <PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
91
+      <AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
92
+    </ClCompile>
93
+    <Link>
94
+      <SubSystem>Console</SubSystem>
95
+      <GenerateWindowsMetadata>true</GenerateWindowsMetadata>
96
+      <ModuleDefinitionFile>ReactNativeWebView.def</ModuleDefinitionFile>
97
+    </Link>
98
+  </ItemDefinitionGroup>
99
+  <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
100
+    <ClCompile>
101
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102
+    </ClCompile>
103
+  </ItemDefinitionGroup>
104
+  <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
105
+    <ClCompile>
106
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
107
+    </ClCompile>
108
+  </ItemDefinitionGroup>
109
+  <ItemGroup>
110
+    <ClInclude Include="ReactWebView.h">
111
+      <DependentUpon>ReactWebView.idl</DependentUpon>
112
+    </ClInclude>
113
+    <ClInclude Include="ReactWebViewManager.h" />
114
+    <ClInclude Include="pch.h" />
115
+    <ClInclude Include="ReactPackageProvider.h">
116
+      <DependentUpon>ReactPackageProvider.idl</DependentUpon>
117
+    </ClInclude>
118
+  </ItemGroup>
119
+  <ItemGroup>
120
+    <ClCompile Include="ReactWebView.cpp">
121
+      <DependentUpon>ReactWebView.idl</DependentUpon>
122
+    </ClCompile>
123
+    <ClCompile Include="ReactWebViewManager.cpp" />
124
+    <ClCompile Include="pch.cpp">
125
+      <PrecompiledHeader>Create</PrecompiledHeader>
126
+    </ClCompile>
127
+    <ClCompile Include="ReactPackageProvider.cpp">
128
+      <DependentUpon>ReactPackageProvider.idl</DependentUpon>
129
+    </ClCompile>
130
+    <ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
131
+  </ItemGroup>
132
+  <ItemGroup>
133
+    <Midl Include="ReactWebView.idl" />
134
+    <Midl Include="ReactPackageProvider.idl" />
135
+  </ItemGroup>
136
+  <ItemGroup>
137
+    <None Include="packages.config" />
138
+    <None Include="ReactNativeWebView.def" />
139
+  </ItemGroup>
140
+  <ItemGroup>
141
+    <None Include="PropertySheet.props" />
142
+  </ItemGroup>
143
+  <ItemGroup>
144
+    <ProjectReference Include="$(ReactNativeWindowsDir)\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj">
145
+      <Project>{f7d32bd0-2749-483e-9a0d-1635ef7e3136}</Project>
146
+      <Private>false</Private>
147
+    </ProjectReference>
148
+  </ItemGroup>
149
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
150
+  <ImportGroup Label="ExtensionTargets">
151
+    <Import Project="$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
152
+  </ImportGroup>
153
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
154
+    <PropertyGroup>
155
+      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
156
+    </PropertyGroup>
157
+    <Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
158
+    <Error Condition="!Exists('$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
159
+  </Target>
162
 </Project>
160
 </Project>

+ 17
- 17
windows/ReactNativeWebView/ReactPackageProvider.cpp Просмотреть файл

1
-#include "pch.h"
2
-#include "ReactPackageProvider.h"
3
-#if __has_include("ReactPackageProvider.g.cpp")
4
-#include "ReactPackageProvider.g.cpp"
5
-#endif
6
-
7
-#include "ReactWebViewManager.h"
8
-
9
-using namespace winrt::Microsoft::ReactNative;
10
-
11
-namespace winrt::ReactNativeWebView::implementation {
12
-
13
-void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept {
14
-  packageBuilder.AddViewManager(L"ReactWebViewManager", []() { return winrt::make<ReactWebViewManager>(); });
15
-}
16
-
17
-} // namespace winrt::ReactNativeWebView::implementation
1
+#include "pch.h"
2
+#include "ReactPackageProvider.h"
3
+#if __has_include("ReactPackageProvider.g.cpp")
4
+#include "ReactPackageProvider.g.cpp"
5
+#endif
6
+
7
+#include "ReactWebViewManager.h"
8
+
9
+using namespace winrt::Microsoft::ReactNative;
10
+
11
+namespace winrt::ReactNativeWebView::implementation {
12
+
13
+void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept {
14
+  packageBuilder.AddViewManager(L"ReactWebViewManager", []() { return winrt::make<ReactWebViewManager>(); });
15
+}
16
+
17
+} // namespace winrt::ReactNativeWebView::implementation

+ 20
- 20
windows/ReactNativeWebView/ReactPackageProvider.h Просмотреть файл

1
-#pragma once
2
-#include "ReactPackageProvider.g.h"
3
-
4
-using namespace winrt::Microsoft::ReactNative;
5
-
6
-namespace winrt::ReactNativeWebView::implementation {
7
-
8
-struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider> {
9
-  ReactPackageProvider() = default;
10
-
11
-  void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
12
-};
13
-
14
-} // namespace winrt::ReactNativeWebView::implementation
15
-
16
-namespace winrt::ReactNativeWebView::factory_implementation {
17
-
18
-struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider, implementation::ReactPackageProvider> {};
19
-
20
-} // namespace winrt::ReactNativeWebView::factory_implementation
1
+#pragma once
2
+#include "ReactPackageProvider.g.h"
3
+
4
+using namespace winrt::Microsoft::ReactNative;
5
+
6
+namespace winrt::ReactNativeWebView::implementation {
7
+
8
+struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider> {
9
+  ReactPackageProvider() = default;
10
+
11
+  void CreatePackage(IReactPackageBuilder const &packageBuilder) noexcept;
12
+};
13
+
14
+} // namespace winrt::ReactNativeWebView::implementation
15
+
16
+namespace winrt::ReactNativeWebView::factory_implementation {
17
+
18
+struct ReactPackageProvider : ReactPackageProviderT<ReactPackageProvider, implementation::ReactPackageProvider> {};
19
+
20
+} // namespace winrt::ReactNativeWebView::factory_implementation

+ 7
- 7
windows/ReactNativeWebView/ReactPackageProvider.idl Просмотреть файл

1
-namespace ReactNativeWebView {
2
-[webhosthidden]
3
-[default_interface] 
4
-runtimeclass ReactPackageProvider : Microsoft.ReactNative.IReactPackageProvider {
5
-  ReactPackageProvider();
6
-};
7
-} // namespace ReactNativeWebView
1
+namespace ReactNativeWebView {
2
+[webhosthidden]
3
+[default_interface] 
4
+runtimeclass ReactPackageProvider : Microsoft.ReactNative.IReactPackageProvider {
5
+  ReactPackageProvider();
6
+};
7
+} // namespace ReactNativeWebView

+ 147
- 143
windows/ReactNativeWebView/ReactWebView.cpp Просмотреть файл

1
-// Copyright (c) Microsoft Corporation. All rights reserved.
2
-// Licensed under the MIT License.
3
-
4
-#include "pch.h"
5
-#include "JSValueXaml.h"
6
-#include "ReactWebView.h"
7
-#include "ReactWebView.g.cpp"
8
-
9
-namespace winrt {
10
-    using namespace Microsoft::ReactNative;
11
-    using namespace Windows::Data::Json;
12
-    using namespace Windows::Foundation;
13
-    using namespace Windows::UI;
14
-    using namespace Windows::UI::Popups;
15
-    using namespace Windows::UI::Xaml;
16
-    using namespace Windows::UI::Xaml::Controls;
17
-    using namespace Windows::UI::Xaml::Input;
18
-    using namespace Windows::UI::Xaml::Media;
19
-} // namespace winrt
20
-
21
-namespace winrt::ReactNativeWebView::implementation {
22
-
23
-    ReactWebView::ReactWebView(winrt::IReactContext const& reactContext) : m_reactContext(reactContext) {
24
-#ifdef CHAKRACORE_UWP
25
-        m_webView = winrt::WebView(winrt::WebViewExecutionMode::SeparateProcess);
26
-#else
27
-        m_webView = winrt::WebView();
28
-#endif
29
-        RegisterEvents();
30
-    }
31
-
32
-    winrt::WebView ReactWebView::GetView() {
33
-        return m_webView;
34
-    }
35
-
36
-    void ReactWebView::RegisterEvents() {
37
-        m_navigationStartingRevoker = m_webView.NavigationStarting(
38
-            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
39
-                if (auto self = ref.get()) {
40
-                    self->OnNavigationStarting(sender, args);
41
-                }
42
-                
43
-            });
44
-
45
-        m_navigationCompletedRevoker = m_webView.NavigationCompleted(
46
-            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
47
-                if (auto self = ref.get()) {
48
-                    self->OnNavigationCompleted(sender, args);
49
-                }
50
-            });
51
-
52
-        m_navigationFailedRevoker = m_webView.NavigationFailed(
53
-            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
54
-                if (auto self = ref.get()) {
55
-                    self->OnNavigationFailed(sender, args);
56
-                }
57
-            });
58
-
59
-        m_scriptNotifyRevoker = m_webView.ScriptNotify(
60
-            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
61
-                if (auto self = ref.get()) {
62
-                    self->OnScriptNotify(sender, args);
63
-                }
64
-            });
65
-    }
66
-
67
-    void ReactWebView::WriteWebViewNavigationEventArg(winrt::IJSValueWriter const& eventDataWriter) {
68
-        auto tag = m_webView.GetValue(winrt::FrameworkElement::TagProperty()).as<winrt::IPropertyValue>().GetInt64();
69
-        WriteProperty(eventDataWriter, L"canGoBack", m_webView.CanGoBack());
70
-        WriteProperty(eventDataWriter, L"canGoForward", m_webView.CanGoForward());
71
-        WriteProperty(eventDataWriter, L"loading", !m_webView.IsLoaded());
72
-        WriteProperty(eventDataWriter, L"target", tag);
73
-        WriteProperty(eventDataWriter, L"title", m_webView.DocumentTitle());
74
-        if (auto uri = m_webView.Source()) {
75
-            WriteProperty(eventDataWriter, L"url", uri.AbsoluteCanonicalUri());
76
-        }
77
-    }
78
-
79
-    void ReactWebView::OnNavigationStarting(winrt::WebView const& webView, winrt::WebViewNavigationStartingEventArgs const& /*args*/) {
80
-        m_reactContext.DispatchEvent(
81
-            webView,
82
-            L"topLoadingStart",
83
-            [&](winrt::IJSValueWriter const& eventDataWriter) noexcept {
84
-                eventDataWriter.WriteObjectBegin();
85
-                WriteWebViewNavigationEventArg(eventDataWriter);
86
-                eventDataWriter.WriteObjectEnd();
87
-            });
88
-    }
89
-
90
-    void ReactWebView::OnNavigationCompleted(winrt::WebView const& webView, winrt::WebViewNavigationCompletedEventArgs const& /*args*/) {
91
-        m_reactContext.DispatchEvent(
92
-            webView,
93
-            L"topLoadingFinish",
94
-            [&](winrt::IJSValueWriter const& eventDataWriter) noexcept {
95
-                eventDataWriter.WriteObjectBegin();
96
-                WriteWebViewNavigationEventArg(eventDataWriter);
97
-                eventDataWriter.WriteObjectEnd();
98
-            });
99
-
100
-        winrt::hstring windowAlert = L"window.alert = function (msg) {window.external.notify(`{\"type\":\"alert\",\"message\":\"${msg}\"}`)};";
101
-        winrt::hstring postMessage = L"window.ReactNativeWebView = {postMessage: function (data) {window.external.notify(String(data))}};";
102
-        m_webView.InvokeScriptAsync(L"eval", { windowAlert + postMessage });
103
-    }
104
-
105
-    void ReactWebView::OnNavigationFailed(winrt::IInspectable const& /*sender*/, winrt::WebViewNavigationFailedEventArgs const& args) {
106
-        m_reactContext.DispatchEvent(
107
-            m_webView,
108
-            L"topLoadingError",
109
-            [&](winrt::IJSValueWriter const& eventDataWriter) noexcept {
110
-                auto httpCode = static_cast<int32_t>(args.WebErrorStatus());
111
-                eventDataWriter.WriteObjectBegin();
112
-                {
113
-                    WriteProperty(eventDataWriter, L"code", httpCode);
114
-                    WriteWebViewNavigationEventArg(eventDataWriter);
115
-                }
116
-                eventDataWriter.WriteObjectEnd();
117
-            });
118
-    }
119
-
120
-    void ReactWebView::OnScriptNotify(winrt::IInspectable const& /*sender*/, winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& args) {
121
-        winrt::JsonObject jsonObject;
122
-        if (winrt::JsonObject::TryParse(args.Value(), jsonObject)) {
123
-            auto type = jsonObject.GetNamedString(L"type");
124
-            if (type == L"alert") {
125
-                auto dialog = winrt::MessageDialog(jsonObject.GetNamedString(L"message"));
126
-                dialog.Commands().Append(winrt::UICommand(L"OK"));
127
-                dialog.ShowAsync();
128
-            }
129
-        }
130
-        else {
131
-            m_reactContext.DispatchEvent(
132
-                m_webView,
133
-                L"topMessage",
134
-                [&](winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter) noexcept {
135
-                    eventDataWriter.WriteObjectBegin();
136
-                    {
137
-                        WriteProperty(eventDataWriter, L"data", winrt::to_string(args.Value()));
138
-                    }
139
-                    eventDataWriter.WriteObjectEnd();
140
-                });
141
-        }
142
-    }
143
-
1
+// Copyright (c) Microsoft Corporation. All rights reserved.
2
+// Licensed under the MIT License.
3
+
4
+#include "pch.h"
5
+#include "JSValueXaml.h"
6
+#include "ReactWebView.h"
7
+#include "ReactWebView.g.cpp"
8
+
9
+namespace winrt {
10
+    using namespace Microsoft::ReactNative;
11
+    using namespace Windows::Data::Json;
12
+    using namespace Windows::Foundation;
13
+    using namespace Windows::UI;
14
+    using namespace Windows::UI::Popups;
15
+    using namespace Windows::UI::Xaml;
16
+    using namespace Windows::UI::Xaml::Controls;
17
+    using namespace Windows::UI::Xaml::Input;
18
+    using namespace Windows::UI::Xaml::Media;
19
+} // namespace winrt
20
+
21
+namespace winrt::ReactNativeWebView::implementation {
22
+
23
+    ReactWebView::ReactWebView(winrt::IReactContext const& reactContext) : m_reactContext(reactContext) {
24
+#ifdef CHAKRACORE_UWP
25
+        m_webView = winrt::WebView(winrt::WebViewExecutionMode::SeparateProcess);
26
+#else
27
+        m_webView = winrt::WebView();
28
+#endif
29
+        RegisterEvents();
30
+    }
31
+
32
+    winrt::WebView ReactWebView::GetView() {
33
+        return m_webView;
34
+    }
35
+
36
+    void ReactWebView::RegisterEvents() {
37
+        m_navigationStartingRevoker = m_webView.NavigationStarting(
38
+            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
39
+                if (auto self = ref.get()) {
40
+                    self->OnNavigationStarting(sender, args);
41
+                }
42
+                
43
+            });
44
+
45
+        m_navigationCompletedRevoker = m_webView.NavigationCompleted(
46
+            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
47
+                if (auto self = ref.get()) {
48
+                    self->OnNavigationCompleted(sender, args);
49
+                }
50
+            });
51
+
52
+        m_navigationFailedRevoker = m_webView.NavigationFailed(
53
+            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
54
+                if (auto self = ref.get()) {
55
+                    self->OnNavigationFailed(sender, args);
56
+                }
57
+            });
58
+
59
+        m_scriptNotifyRevoker = m_webView.ScriptNotify(
60
+            winrt::auto_revoke, [ref = get_weak()](auto const& sender, auto const& args) {
61
+                if (auto self = ref.get()) {
62
+                    self->OnScriptNotify(sender, args);
63
+                }
64
+            });
65
+    }
66
+
67
+    void ReactWebView::WriteWebViewNavigationEventArg(winrt::IJSValueWriter const& eventDataWriter) {
68
+        auto tag = m_webView.GetValue(winrt::FrameworkElement::TagProperty()).as<winrt::IPropertyValue>().GetInt64();
69
+        WriteProperty(eventDataWriter, L"canGoBack", m_webView.CanGoBack());
70
+        WriteProperty(eventDataWriter, L"canGoForward", m_webView.CanGoForward());
71
+        WriteProperty(eventDataWriter, L"loading", !m_webView.IsLoaded());
72
+        WriteProperty(eventDataWriter, L"target", tag);
73
+        WriteProperty(eventDataWriter, L"title", m_webView.DocumentTitle());
74
+        if (auto uri = m_webView.Source()) {
75
+            WriteProperty(eventDataWriter, L"url", uri.AbsoluteCanonicalUri());
76
+        }
77
+    }
78
+
79
+    void ReactWebView::OnNavigationStarting(winrt::WebView const& webView, winrt::WebViewNavigationStartingEventArgs const& /*args*/) {
80
+        m_reactContext.DispatchEvent(
81
+            webView,
82
+            L"topLoadingStart",
83
+            [&](winrt::IJSValueWriter const& eventDataWriter) noexcept {
84
+                eventDataWriter.WriteObjectBegin();
85
+                WriteWebViewNavigationEventArg(eventDataWriter);
86
+                eventDataWriter.WriteObjectEnd();
87
+            });
88
+    }
89
+
90
+    void ReactWebView::OnNavigationCompleted(winrt::WebView const& webView, winrt::WebViewNavigationCompletedEventArgs const& /*args*/) {
91
+        m_reactContext.DispatchEvent(
92
+            webView,
93
+            L"topLoadingFinish",
94
+            [&](winrt::IJSValueWriter const& eventDataWriter) noexcept {
95
+                eventDataWriter.WriteObjectBegin();
96
+                WriteWebViewNavigationEventArg(eventDataWriter);
97
+                eventDataWriter.WriteObjectEnd();
98
+            });
99
+
100
+        winrt::hstring windowAlert = L"window.alert = function (msg) {window.external.notify(`{\"type\":\"__alert\",\"message\":\"${msg}\"}`)};";
101
+        winrt::hstring postMessage = L"window.ReactNativeWebView = {postMessage: function (data) {window.external.notify(String(data))}};";
102
+        m_webView.InvokeScriptAsync(L"eval", { windowAlert + postMessage });
103
+    }
104
+
105
+    void ReactWebView::OnNavigationFailed(winrt::IInspectable const& /*sender*/, winrt::WebViewNavigationFailedEventArgs const& args) {
106
+        m_reactContext.DispatchEvent(
107
+            m_webView,
108
+            L"topLoadingError",
109
+            [&](winrt::IJSValueWriter const& eventDataWriter) noexcept {
110
+                auto httpCode = static_cast<int32_t>(args.WebErrorStatus());
111
+                eventDataWriter.WriteObjectBegin();
112
+                {
113
+                    WriteProperty(eventDataWriter, L"code", httpCode);
114
+                    WriteWebViewNavigationEventArg(eventDataWriter);
115
+                }
116
+                eventDataWriter.WriteObjectEnd();
117
+            });
118
+    }
119
+
120
+    void ReactWebView::OnScriptNotify(winrt::IInspectable const& /*sender*/, winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& args) {
121
+        winrt::JsonObject jsonObject;
122
+        if (winrt::JsonObject::TryParse(args.Value(), jsonObject) && jsonObject.HasKey(L"type")) {
123
+            auto type = jsonObject.GetNamedString(L"type");
124
+            if (type == L"__alert") {
125
+                auto dialog = winrt::MessageDialog(jsonObject.GetNamedString(L"message"));
126
+                dialog.Commands().Append(winrt::UICommand(L"OK"));
127
+                dialog.ShowAsync();
128
+                return;
129
+            }
130
+        }
131
+        
132
+        PostMessage(winrt::hstring(args.Value()));
133
+    }
134
+
135
+    void ReactWebView::PostMessage(winrt::hstring const& message) {
136
+        m_reactContext.DispatchEvent(
137
+            m_webView,
138
+            L"topMessage",
139
+            [&](winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter) noexcept {
140
+                eventDataWriter.WriteObjectBegin();
141
+                {
142
+                    WriteProperty(eventDataWriter, L"data", message);
143
+                }
144
+                eventDataWriter.WriteObjectEnd();
145
+            });
146
+    }
147
+
144
 } // namespace winrt::ReactNativeWebView::implementation
148
 } // namespace winrt::ReactNativeWebView::implementation

+ 36
- 35
windows/ReactNativeWebView/ReactWebView.h Просмотреть файл

1
-// Copyright (c) Microsoft Corporation. All rights reserved.
2
-// Licensed under the MIT License.
3
-
4
-#pragma once
5
-
6
-#include "winrt/Microsoft.ReactNative.h"
7
-#include "NativeModules.h"
8
-#include "ReactWebView.g.h"
9
-
10
-namespace winrt::ReactNativeWebView::implementation {
11
-
12
-    class ReactWebView : public ReactWebViewT<ReactWebView> {
13
-    public:
14
-        ReactWebView(Microsoft::ReactNative::IReactContext const& reactContext);
15
-        winrt::Windows::UI::Xaml::Controls::WebView GetView();
16
-
17
-    private:
18
-        winrt::Windows::UI::Xaml::Controls::WebView m_webView{ nullptr };
19
-        Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
20
-        winrt::Windows::UI::Xaml::Controls::WebView::NavigationStarting_revoker m_navigationStartingRevoker{};
21
-        winrt::Windows::UI::Xaml::Controls::WebView::NavigationCompleted_revoker m_navigationCompletedRevoker{};
22
-        winrt::Windows::UI::Xaml::Controls::WebView::NavigationFailed_revoker m_navigationFailedRevoker{};
23
-        winrt::Windows::UI::Xaml::Controls::WebView::ScriptNotify_revoker m_scriptNotifyRevoker{};
24
-
25
-        void RegisterEvents();
26
-        void WriteWebViewNavigationEventArg(winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter);
27
-        void OnNavigationStarting(winrt::Windows::UI::Xaml::Controls::WebView const& sender, winrt::Windows::UI::Xaml::Controls::WebViewNavigationStartingEventArgs const& args);
28
-        void OnNavigationCompleted(winrt::Windows::UI::Xaml::Controls::WebView const& sender, winrt::Windows::UI::Xaml::Controls::WebViewNavigationCompletedEventArgs const& args);
29
-        void OnNavigationFailed(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::WebViewNavigationFailedEventArgs const& args);
30
-        void OnScriptNotify(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& args);
31
-    };
32
-} // namespace winrt::ReactNativeWebView::implementation
33
-
34
-namespace winrt::ReactNativeWebView::factory_implementation {
35
-    struct ReactWebView : ReactWebViewT<ReactWebView, implementation::ReactWebView> {};
1
+// Copyright (c) Microsoft Corporation. All rights reserved.
2
+// Licensed under the MIT License.
3
+
4
+#pragma once
5
+
6
+#include "winrt/Microsoft.ReactNative.h"
7
+#include "NativeModules.h"
8
+#include "ReactWebView.g.h"
9
+
10
+namespace winrt::ReactNativeWebView::implementation {
11
+
12
+    class ReactWebView : public ReactWebViewT<ReactWebView> {
13
+    public:
14
+        ReactWebView(Microsoft::ReactNative::IReactContext const& reactContext);
15
+        winrt::Windows::UI::Xaml::Controls::WebView GetView();
16
+        void PostMessage(winrt::hstring const& message);
17
+
18
+    private:
19
+        winrt::Windows::UI::Xaml::Controls::WebView m_webView{ nullptr };
20
+        Microsoft::ReactNative::IReactContext m_reactContext{ nullptr };
21
+        winrt::Windows::UI::Xaml::Controls::WebView::NavigationStarting_revoker m_navigationStartingRevoker{};
22
+        winrt::Windows::UI::Xaml::Controls::WebView::NavigationCompleted_revoker m_navigationCompletedRevoker{};
23
+        winrt::Windows::UI::Xaml::Controls::WebView::NavigationFailed_revoker m_navigationFailedRevoker{};
24
+        winrt::Windows::UI::Xaml::Controls::WebView::ScriptNotify_revoker m_scriptNotifyRevoker{};
25
+
26
+        void RegisterEvents();
27
+        void WriteWebViewNavigationEventArg(winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter);
28
+        void OnNavigationStarting(winrt::Windows::UI::Xaml::Controls::WebView const& sender, winrt::Windows::UI::Xaml::Controls::WebViewNavigationStartingEventArgs const& args);
29
+        void OnNavigationCompleted(winrt::Windows::UI::Xaml::Controls::WebView const& sender, winrt::Windows::UI::Xaml::Controls::WebViewNavigationCompletedEventArgs const& args);
30
+        void OnNavigationFailed(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::WebViewNavigationFailedEventArgs const& args);
31
+        void OnScriptNotify(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& args);
32
+    };
33
+} // namespace winrt::ReactNativeWebView::implementation
34
+
35
+namespace winrt::ReactNativeWebView::factory_implementation {
36
+    struct ReactWebView : ReactWebViewT<ReactWebView, implementation::ReactWebView> {};
36
 } // namespace winrt::ReactNativeWebView::factory_implementation
37
 } // namespace winrt::ReactNativeWebView::factory_implementation

+ 7
- 6
windows/ReactNativeWebView/ReactWebView.idl Просмотреть файл

1
-namespace ReactNativeWebView{
2
-    [default_interface]
3
-    runtimeclass ReactWebView : Windows.UI.Xaml.Controls.UserControl{
4
-        ReactWebView(Microsoft.ReactNative.IReactContext context);
5
-        Windows.UI.Xaml.Controls.WebView GetView();
6
-    };
1
+namespace ReactNativeWebView{
2
+    [default_interface]
3
+    runtimeclass ReactWebView : Windows.UI.Xaml.Controls.UserControl{
4
+        ReactWebView(Microsoft.ReactNative.IReactContext context);
5
+        Windows.UI.Xaml.Controls.WebView GetView();
6
+        void PostMessage(String message);
7
+    };
7
 } // namespace ReactNativeWebView
8
 } // namespace ReactNativeWebView

+ 144
- 143
windows/ReactNativeWebView/ReactWebViewManager.cpp Просмотреть файл

1
-#include "pch.h"
2
-#include "ReactWebViewManager.h"
3
-#include "NativeModules.h"
4
-#include "ReactWebView.h"
5
-#include "JSValueXaml.h"
6
-
7
-namespace winrt {
8
-    using namespace Microsoft::ReactNative;
9
-    using namespace Windows::Foundation;
10
-    using namespace Windows::Foundation::Collections;
11
-    using namespace Windows::UI;
12
-    using namespace Windows::UI::Xaml;
13
-    using namespace Windows::UI::Xaml::Controls;
14
-}
15
-
16
-namespace winrt::ReactNativeWebView::implementation {
17
-
18
-    ReactWebViewManager::ReactWebViewManager() {}
19
-
20
-    // IViewManager
21
-    winrt::hstring ReactWebViewManager::Name() noexcept {
22
-        return L"RCTWebView";
23
-    }
24
-
25
-    winrt::FrameworkElement ReactWebViewManager::CreateView() noexcept {
26
-        m_reactWebView = *winrt::make_self<ReactWebView>(m_reactContext);
27
-        return m_reactWebView.GetView();
28
-    }
29
-
30
-    // IViewManagerWithReactContext
31
-    winrt::IReactContext ReactWebViewManager::ReactContext() noexcept {
32
-        return m_reactContext;
33
-    }
34
-
35
-    void ReactWebViewManager::ReactContext(IReactContext reactContext) noexcept {
36
-        m_reactContext = reactContext;
37
-    }
38
-
39
-    // IViewManagerWithNativeProperties
40
-    IMapView<hstring, ViewManagerPropertyType> ReactWebViewManager::NativeProps() noexcept {
41
-        auto nativeProps = winrt::single_threaded_map<hstring, ViewManagerPropertyType>();
42
-        nativeProps.Insert(L"source", ViewManagerPropertyType::Map);
43
-        return nativeProps.GetView();
44
-    }
45
-
46
-    void ReactWebViewManager::UpdateProperties(
47
-        FrameworkElement const& view,
48
-        IJSValueReader const& propertyMapReader) noexcept {
49
-        if (auto webView = view.try_as<winrt::WebView>()) {
50
-            const JSValueObject& propertyMap = JSValueObject::ReadFrom(propertyMapReader);
51
-
52
-            for (auto const& pair : propertyMap) {
53
-                auto const& propertyName = pair.first;
54
-                auto const& propertyValue = pair.second;
55
-                if (propertyValue.IsNull()) continue;
56
-
57
-                if (propertyName == "source") {
58
-                    auto const& srcMap = propertyValue.AsObject();
59
-                    if (srcMap.find("uri") != srcMap.end()) {
60
-                        auto uriString = srcMap.at("uri").AsString();
61
-                        // non-uri sources not yet supported
62
-                        if (uriString.length() == 0) {
63
-                            continue;
64
-                        }
65
-
66
-                        bool isPackagerAsset = false;
67
-                        if (srcMap.find("__packager_asset") != srcMap.end()) {
68
-                            isPackagerAsset = srcMap.at("__packager_asset").AsBoolean();
69
-                        }
70
-
71
-                        if (isPackagerAsset && uriString.find("assets") == 0) {
72
-                            uriString.replace(0, 6, "ms-appx://");
73
-                        }
74
-
75
-                        webView.Navigate(winrt::Uri(to_hstring(uriString)));
76
-                    }
77
-                    else if (srcMap.find("html") != srcMap.end()) {
78
-                        auto htmlString = srcMap.at("html").AsString();
79
-                        webView.NavigateToString(to_hstring(htmlString));
80
-                    }
81
-                }
82
-                else if (propertyName == "backgroundColor") {
83
-                    auto color = propertyValue.To<winrt::Color>();
84
-                    webView.DefaultBackgroundColor(color.A==0 ? winrt::Colors::Transparent() : color);
85
-                }
86
-            }
87
-        }
88
-    }
89
-
90
-    // IViewManagerWithExportedEventTypeConstants
91
-    ConstantProviderDelegate ReactWebViewManager::ExportedCustomBubblingEventTypeConstants() noexcept {
92
-        return nullptr;
93
-    }
94
-
95
-    ConstantProviderDelegate ReactWebViewManager::ExportedCustomDirectEventTypeConstants() noexcept {
96
-        return [](winrt::IJSValueWriter const& constantWriter) {
97
-            WriteCustomDirectEventTypeConstant(constantWriter, "onLoadingStart");
98
-            WriteCustomDirectEventTypeConstant(constantWriter, "onLoadingFinish");
99
-            WriteCustomDirectEventTypeConstant(constantWriter, "onLoadingError");
100
-            WriteCustomDirectEventTypeConstant(constantWriter, "onMessage");
101
-        };
102
-    }
103
-
104
-    // IViewManagerWithCommands
105
-    IMapView<hstring, int64_t> ReactWebViewManager::Commands() noexcept {
106
-        auto commands = winrt::single_threaded_map<hstring, int64_t>();
107
-        commands.Insert(L"goForward", static_cast<int32_t>(WebViewCommands::GoForward));
108
-        commands.Insert(L"goBack", static_cast<int32_t>(WebViewCommands::GoBack));
109
-        commands.Insert(L"reload", static_cast<int32_t>(WebViewCommands::Reload));
110
-        commands.Insert(L"stopLoading", static_cast<int32_t>(WebViewCommands::StopLoading));
111
-        commands.Insert(L"injectJavaScript", static_cast<int32_t>(WebViewCommands::InjectJavaScript));
112
-        return commands.GetView();
113
-    }
114
-
115
-    void ReactWebViewManager::DispatchCommand(
116
-        FrameworkElement const& view,
117
-        int64_t commandId,
118
-        winrt::IJSValueReader const& commandArgsReader) noexcept {
119
-        if (auto webView = view.try_as<winrt::WebView>()) {
120
-            switch (commandId) {
121
-                case static_cast<int64_t>(WebViewCommands::GoForward) :
122
-                    if (webView.CanGoForward()) {
123
-                        webView.GoForward();
124
-                    }
125
-                    break;
126
-                case static_cast<int64_t>(WebViewCommands::GoBack) :
127
-                    if (webView.CanGoBack()) {
128
-                        webView.GoBack();
129
-                    }
130
-                    break;
131
-                case static_cast<int64_t>(WebViewCommands::Reload) :
132
-                    webView.Refresh();
133
-                    break;
134
-                case static_cast<int64_t>(WebViewCommands::StopLoading) :
135
-                    webView.Stop();
136
-                    break;
137
-                case static_cast<int64_t>(WebViewCommands::InjectJavaScript) :
138
-                    webView.InvokeScriptAsync(L"eval", { commandArgsReader.GetString() });
139
-                    break;
140
-            }
141
-        }
142
-    }
143
-
1
+#include "pch.h"
2
+#include "ReactWebViewManager.h"
3
+#include "NativeModules.h"
4
+#include "ReactWebView.h"
5
+#include "JSValueXaml.h"
6
+
7
+namespace winrt {
8
+    using namespace Microsoft::ReactNative;
9
+    using namespace Windows::Foundation;
10
+    using namespace Windows::Foundation::Collections;
11
+    using namespace Windows::UI;
12
+    using namespace Windows::UI::Xaml;
13
+    using namespace Windows::UI::Xaml::Controls;
14
+}
15
+
16
+namespace winrt::ReactNativeWebView::implementation {
17
+
18
+    ReactWebViewManager::ReactWebViewManager() {}
19
+
20
+    // IViewManager
21
+    winrt::hstring ReactWebViewManager::Name() noexcept {
22
+        return L"RCTWebView";
23
+    }
24
+
25
+    winrt::FrameworkElement ReactWebViewManager::CreateView() noexcept {
26
+        m_reactWebView = *winrt::make_self<ReactWebView>(m_reactContext);
27
+        return m_reactWebView.GetView();
28
+    }
29
+
30
+    // IViewManagerWithReactContext
31
+    winrt::IReactContext ReactWebViewManager::ReactContext() noexcept {
32
+        return m_reactContext;
33
+    }
34
+
35
+    void ReactWebViewManager::ReactContext(IReactContext reactContext) noexcept {
36
+        m_reactContext = reactContext;
37
+    }
38
+
39
+    // IViewManagerWithNativeProperties
40
+    IMapView<hstring, ViewManagerPropertyType> ReactWebViewManager::NativeProps() noexcept {
41
+        auto nativeProps = winrt::single_threaded_map<hstring, ViewManagerPropertyType>();
42
+        nativeProps.Insert(L"source", ViewManagerPropertyType::Map);
43
+        return nativeProps.GetView();
44
+    }
45
+
46
+    void ReactWebViewManager::UpdateProperties(
47
+        FrameworkElement const& view,
48
+        IJSValueReader const& propertyMapReader) noexcept {
49
+        if (auto webView = view.try_as<winrt::WebView>()) {
50
+            const JSValueObject& propertyMap = JSValueObject::ReadFrom(propertyMapReader);
51
+
52
+            for (auto const& pair : propertyMap) {
53
+                auto const& propertyName = pair.first;
54
+                auto const& propertyValue = pair.second;
55
+                if (propertyValue.IsNull()) continue;
56
+
57
+                if (propertyName == "source") {
58
+                    auto const& srcMap = propertyValue.AsObject();
59
+                    if (srcMap.find("uri") != srcMap.end()) {
60
+                        auto uriString = srcMap.at("uri").AsString();
61
+                        if (uriString.length() == 0) {
62
+                            continue;
63
+                        }
64
+
65
+                        bool isPackagerAsset = false;
66
+                        if (srcMap.find("__packager_asset") != srcMap.end()) {
67
+                            isPackagerAsset = srcMap.at("__packager_asset").AsBoolean();
68
+                        }
69
+                        if (isPackagerAsset && uriString.find("file://") == 0) {
70
+                            auto bundleRootPath = winrt::to_string(ReactNativeHost().InstanceSettings().BundleRootPath());
71
+                            uriString.replace(0, 7, bundleRootPath.empty() ? "ms-appx-web:///Bundle/" : bundleRootPath);
72
+                        }
73
+
74
+                        webView.Navigate(winrt::Uri(to_hstring(uriString)));
75
+                    }
76
+                    else if (srcMap.find("html") != srcMap.end()) {
77
+                        auto htmlString = srcMap.at("html").AsString();
78
+                        webView.NavigateToString(to_hstring(htmlString));
79
+                    }
80
+                }
81
+                else if (propertyName == "backgroundColor") {
82
+                    auto color = propertyValue.To<winrt::Color>();
83
+                    webView.DefaultBackgroundColor(color.A==0 ? winrt::Colors::Transparent() : color);
84
+                }
85
+            }
86
+        }
87
+    }
88
+
89
+    // IViewManagerWithExportedEventTypeConstants
90
+    ConstantProviderDelegate ReactWebViewManager::ExportedCustomBubblingEventTypeConstants() noexcept {
91
+        return nullptr;
92
+    }
93
+
94
+    ConstantProviderDelegate ReactWebViewManager::ExportedCustomDirectEventTypeConstants() noexcept {
95
+        return [](winrt::IJSValueWriter const& constantWriter) {
96
+            WriteCustomDirectEventTypeConstant(constantWriter, "LoadingStart");
97
+            WriteCustomDirectEventTypeConstant(constantWriter, "LoadingFinish");
98
+            WriteCustomDirectEventTypeConstant(constantWriter, "LoadingError");
99
+            WriteCustomDirectEventTypeConstant(constantWriter, "Message");
100
+        };
101
+    }
102
+
103
+    // IViewManagerWithCommands
104
+    IVectorView<hstring> ReactWebViewManager::Commands() noexcept {
105
+        auto commands = winrt::single_threaded_vector<hstring>();
106
+        commands.Append(L"goForward");
107
+        commands.Append(L"goBack");
108
+        commands.Append(L"reload");
109
+        commands.Append(L"stopLoading");
110
+        commands.Append(L"injectJavaScript");
111
+        commands.Append(L"postMessage");
112
+        return commands.GetView();
113
+    }
114
+
115
+    void ReactWebViewManager::DispatchCommand(
116
+        FrameworkElement const& view,
117
+        winrt::hstring const& commandId,
118
+        winrt::IJSValueReader const& commandArgsReader) noexcept {
119
+        auto commandArgs = JSValue::ReadArrayFrom(commandArgsReader);
120
+        if (auto webView = view.try_as<winrt::WebView>()) {
121
+            if (commandId == L"goForward") {
122
+                if (webView.CanGoForward()) {
123
+                    webView.GoForward();
124
+                }
125
+            }
126
+            else if (commandId == L"goBack") {
127
+                if (webView.CanGoBack()) {
128
+                    webView.GoBack();
129
+                }
130
+            }
131
+            else if (commandId == L"reload") {
132
+                webView.Refresh();
133
+            }
134
+            else if (commandId == L"stopLoading") {
135
+                webView.Stop();
136
+            }
137
+            else if (commandId == L"injectJavaScript") {
138
+                webView.InvokeScriptAsync(L"eval", { winrt::to_hstring(commandArgs[0].AsString()) });
139
+            } else if(commandId == L"postMessage") {
140
+                m_reactWebView.PostMessage(winrt::to_hstring(commandArgs[0].AsString()));
141
+            }
142
+        }
143
+    }
144
+
144
 } // namespace winrt::ReactWebView::implementation
145
 } // namespace winrt::ReactWebView::implementation

+ 2
- 4
windows/ReactNativeWebView/ReactWebViewManager.h Просмотреть файл

8
 
8
 
9
 namespace winrt::ReactNativeWebView::implementation {
9
 namespace winrt::ReactNativeWebView::implementation {
10
     
10
     
11
-    enum class WebViewCommands : int32_t { GoForward = 0, GoBack = 1,  Reload = 2, StopLoading = 3, InjectJavaScript = 4 };
12
-
13
     class ReactWebViewManager : public winrt::implements<
11
     class ReactWebViewManager : public winrt::implements<
14
         ReactWebViewManager,
12
         ReactWebViewManager,
15
         winrt::Microsoft::ReactNative::IViewManager,
13
         winrt::Microsoft::ReactNative::IViewManager,
41
         winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomDirectEventTypeConstants() noexcept;
39
         winrt::Microsoft::ReactNative::ConstantProviderDelegate ExportedCustomDirectEventTypeConstants() noexcept;
42
 
40
 
43
         // IViewManagerWithCommands
41
         // IViewManagerWithCommands
44
-        winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, int64_t> Commands() noexcept;
42
+        winrt::Windows::Foundation::Collections::IVectorView<winrt::hstring> Commands() noexcept;
45
 
43
 
46
         void DispatchCommand(
44
         void DispatchCommand(
47
             winrt::Windows::UI::Xaml::FrameworkElement const& view,
45
             winrt::Windows::UI::Xaml::FrameworkElement const& view,
48
-            int64_t commandId,
46
+            winrt::hstring const& commandId,
49
             winrt::Microsoft::ReactNative::IJSValueReader const& commandArgsReader) noexcept;
47
             winrt::Microsoft::ReactNative::IJSValueReader const& commandArgsReader) noexcept;
50
 
48
 
51
     private:
49
     private:

+ 3
- 3
windows/ReactNativeWebView/packages.config Просмотреть файл

1
-<?xml version="1.0" encoding="utf-8"?>
2
-<packages>
3
-  <package id="Microsoft.Windows.CppWinRT" version="2.0.190730.2" targetFramework="native" />
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<packages>
3
+  <package id="Microsoft.Windows.CppWinRT" version="2.0.190730.2" targetFramework="native" />
4
 </packages>
4
 </packages>

+ 1
- 1
windows/ReactNativeWebView/pch.cpp Просмотреть файл

1
-#include "pch.h"
1
+#include "pch.h"

+ 13
- 13
windows/ReactNativeWebView/pch.h Просмотреть файл

1
-#pragma once
2
-
3
-#define NOMINMAX
4
-#include <unknwn.h>
5
-#include <winrt/Windows.Data.Json.h>
6
-#include <winrt/Windows.Foundation.h>
7
-#include <winrt/Windows.Foundation.Collections.h>
8
-#include <winrt/Windows.UI.Popups.h>
9
-#include <winrt/Windows.UI.Xaml.h>
10
-#include <winrt/Windows.UI.Xaml.Controls.h>
11
-#include <winrt/Windows.UI.Xaml.Markup.h>
12
-#include <winrt/Windows.UI.Xaml.Navigation.h>
13
-#include <winrt/Microsoft.ReactNative.h>
1
+#pragma once
2
+
3
+#define NOMINMAX
4
+#include <unknwn.h>
5
+#include <winrt/Windows.Data.Json.h>
6
+#include <winrt/Windows.Foundation.h>
7
+#include <winrt/Windows.Foundation.Collections.h>
8
+#include <winrt/Windows.UI.Popups.h>
9
+#include <winrt/Windows.UI.Xaml.h>
10
+#include <winrt/Windows.UI.Xaml.Controls.h>
11
+#include <winrt/Windows.UI.Xaml.Markup.h>
12
+#include <winrt/Windows.UI.Xaml.Navigation.h>
13
+#include <winrt/Microsoft.ReactNative.h>

+ 13711
- 10587
yarn.lock
Разница между файлами не показана из-за своего большого размера
Просмотреть файл