Selaa lähdekoodia

Merge branch 'master' into android-permissions

Thibaud 4 vuotta sitten
vanhempi
commit
38f70c886c
79 muutettua tiedostoa jossa 17484 lisäystä ja 17596 poistoa
  1. 12
    0
      .gitattributes
  2. 5
    11
      .github/workflows/windows-ci.yml
  3. 3
    4
      README.md
  4. 8
    0
      android/build.gradle
  5. 2
    2
      android/gradle.properties
  6. 270
    30
      android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java
  7. 48
    7
      android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java
  8. 26
    0
      android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt
  9. 2
    0
      android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt
  10. 10
    0
      apple/RNCWebView.h
  11. 62
    40
      apple/RNCWebView.m
  12. 20
    0
      apple/RNCWebViewManager.m
  13. 1
    1
      docs/Custom-Android.md
  14. 3
    1
      docs/Debugging.md
  15. 26
    16
      docs/Guide.md
  16. 5
    1
      docs/README.portuguese.md
  17. 255
    137
      docs/Reference.md
  18. 7
    0
      example/android/app/src/main/java/com/example/MainApplication.java
  19. 4
    4
      example/android/build.gradle
  20. 1
    1
      example/android/gradle/wrapper/gradle-wrapper.properties
  21. 2
    2
      example/android/gradlew
  22. 100
    100
      example/android/gradlew.bat
  23. 28
    27
      example/examples/Injection.tsx
  24. 3
    3
      example/ios/Podfile
  25. 181
    157
      example/ios/Podfile.lock
  26. 11
    7
      example/ios/example.xcodeproj/project.pbxproj
  27. 2
    43
      example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme
  28. 2
    43
      example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme
  29. 42
    42
      example/macos/Podfile
  30. 8
    8
      example/macos/example-iOS/AppDelegate.h
  31. 35
    35
      example/macos/example-iOS/AppDelegate.m
  32. 42
    42
      example/macos/example-iOS/Base.lproj/LaunchScreen.xib
  33. 37
    37
      example/macos/example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json
  34. 6
    6
      example/macos/example-iOS/Images.xcassets/Contents.json
  35. 57
    57
      example/macos/example-iOS/Info.plist
  36. 9
    9
      example/macos/example-iOS/main.m
  37. 9
    9
      example/macos/example-macOS/AppDelegate.h
  38. 32
    32
      example/macos/example-macOS/AppDelegate.m
  39. 58
    58
      example/macos/example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json
  40. 6
    6
      example/macos/example-macOS/Assets.xcassets/Contents.json
  41. 717
    717
      example/macos/example-macOS/Base.lproj/Main.storyboard
  42. 47
    47
      example/macos/example-macOS/Info.plist
  43. 5
    5
      example/macos/example-macOS/ViewController.h
  44. 22
    22
      example/macos/example-macOS/ViewController.m
  45. 12
    12
      example/macos/example-macOS/example.entitlements
  46. 5
    5
      example/macos/example-macOS/main.m
  47. 78
    78
      example/macos/example.xcodeproj/xcshareddata/xcschemes/example-iOS.xcscheme
  48. 78
    78
      example/macos/example.xcodeproj/xcshareddata/xcschemes/example-macOS.xcscheme
  49. 1
    0
      example/windows/WebViewWindows.sln
  50. 0
    5
      example/windows/WebViewWindows/App.cpp
  51. 3
    4
      example/windows/WebViewWindows/WebViewWindows.vcxproj
  52. 24
    24
      example/windows/WebViewWindows/pch.h
  53. 24
    1
      index.d.ts
  54. 2
    0
      metro.config.windows.js
  55. 90
    91
      package.json
  56. 1
    1
      react-native-webview.podspec
  57. 14
    0
      react-native.config.js
  58. 17
    3
      src/WebView.android.tsx
  59. 18
    3
      src/WebView.tsx
  60. 266
    258
      src/WebView.windows.tsx
  61. 2
    2
      src/WebViewShared.tsx
  62. 97
    10
      src/WebViewTypes.ts
  63. 204
    204
      windows/ReactNativeWebView.sln
  64. 15
    15
      windows/ReactNativeWebView/PropertySheet.props
  65. 3
    3
      windows/ReactNativeWebView/ReactNativeWebView.def
  66. 32
    32
      windows/ReactNativeWebView/ReactNativeWebView.filters
  67. 159
    161
      windows/ReactNativeWebView/ReactNativeWebView.vcxproj
  68. 17
    17
      windows/ReactNativeWebView/ReactPackageProvider.cpp
  69. 20
    20
      windows/ReactNativeWebView/ReactPackageProvider.h
  70. 7
    7
      windows/ReactNativeWebView/ReactPackageProvider.idl
  71. 147
    143
      windows/ReactNativeWebView/ReactWebView.cpp
  72. 36
    35
      windows/ReactNativeWebView/ReactWebView.h
  73. 7
    6
      windows/ReactNativeWebView/ReactWebView.idl
  74. 144
    143
      windows/ReactNativeWebView/ReactWebViewManager.cpp
  75. 2
    4
      windows/ReactNativeWebView/ReactWebViewManager.h
  76. 3
    3
      windows/ReactNativeWebView/packages.config
  77. 1
    1
      windows/ReactNativeWebView/pch.cpp
  78. 13
    13
      windows/ReactNativeWebView/pch.h
  79. 13711
    14445
      yarn.lock

+ 12
- 0
.gitattributes Näytä tiedosto

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
+

+ 5
- 11
.github/workflows/windows-ci.yml Näytä tiedosto

15
       with:
15
       with:
16
         node-version: '12.9.1'
16
         node-version: '12.9.1'
17
 
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
18
     - name: Setup MSBuild
23
       uses: microsoft/setup-msbuild@v1.0.0
19
       uses: microsoft/setup-msbuild@v1.0.0
24
       with:
20
       with:
25
         vs-version: 16.5
21
         vs-version: 16.5
26
-       
27
-    - name: Setup NuGet
28
-      uses: NuGet/setup-nuget@v1.0.2
29
 
22
 
30
     - name: Check node modules cache
23
     - name: Check node modules cache
31
       uses: actions/cache@v1
24
       uses: actions/cache@v1
45
       run: |
38
       run: |
46
         yarn build
39
         yarn build
47
         yarn tsc
40
         yarn tsc
48
- 
49
-    - name: NuGet restore
50
-      run: nuget restore example\windows\WebViewWindows.sln
51
 
41
 
52
     - name: Build x64 release
42
     - name: Build x64 release
53
-      run: msbuild example\windows\WebViewWindows.sln /p:Configuration=Release /p:Platform=x64 -m
43
+      shell: powershell
44
+      run: npx react-native run-windows --root example --arch x64 --release --no-packager --no-deploy --logging
54
 
45
 
46
+    # Workaround for a bug in package searching during deploy.
47
+    # The deploy script only searches windows/{*/bin/x64/Release,Release/*}, but the build step above placed the pakcages at windows/x64/Release.
48
+    # Copy the packages to Windows/Release before deploying.
55
     - name: Deploy
49
     - name: Deploy
56
       shell: powershell
50
       shell: powershell
57
       run: |
51
       run: |

+ 3
- 4
README.md Näytä tiedosto

37
 
37
 
38
 Current Version: ![version](https://img.shields.io/npm/v/react-native-webview.svg)
38
 Current Version: ![version](https://img.shields.io/npm/v/react-native-webview.svg)
39
 
39
 
40
+- [10.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v10.0.0) - Android Gradle plugin is only required when opening the project stand-alone
41
+- [9.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v9.0.0) - props updates to injectedJavaScript are no longer immutable.
40
 - [8.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange now triggers with hash url changes
42
 - [8.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v8.0.0) - onNavigationStateChange now triggers with hash url changes
41
-
42
 - [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView
43
 - [7.0.1](https://github.com/react-native-community/react-native-webview/releases/tag/v7.0.1) - Removed UIWebView
43
-
44
 - [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update to AndroidX. Make sure to enable it in your project's `android/gradle.properties`. See [Getting Started Guide](docs/Getting-Started.md).
44
 - [6.0.**2**](https://github.com/react-native-community/react-native-webview/releases/tag/v6.0.2) - Update to AndroidX. Make sure to enable it in your project's `android/gradle.properties`. See [Getting Started Guide](docs/Getting-Started.md).
45
-
46
 - [5.0.**1**](https://github.com/react-native-community/react-native-webview/releases/tag/v5.0.0) - Refactored the old postMessage implementation for communication from webview to native.
45
 - [5.0.**1**](https://github.com/react-native-community/react-native-webview/releases/tag/v5.0.0) - Refactored the old postMessage implementation for communication from webview to native.
47
 - [4.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v4.0.0) - Added cache (enabled by default).
46
 - [4.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v4.0.0) - Added cache (enabled by default).
48
 - [3.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v3.0.0) - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default).
47
 - [3.0.0](https://github.com/react-native-community/react-native-webview/releases/tag/v3.0.0) - WKWebview: Add shared process pool so cookies and localStorage are shared across webviews in iOS (enabled by default).
97
 
96
 
98
 MIT
97
 MIT
99
 
98
 
100
-## Traduções
99
+## Translations
101
 
100
 
102
 This readme is available in:
101
 This readme is available in:
103
 
102
 

+ 8
- 0
android/build.gradle Näytä tiedosto

16
       classpath("com.android.tools.build:gradle:3.6.0")
16
       classpath("com.android.tools.build:gradle:3.6.0")
17
       classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
17
       classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
18
     }
18
     }
19
+  } else {
20
+    repositories {
21
+      jcenter()
22
+    }
23
+
24
+    dependencies {
25
+      classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
26
+    }
19
   }
27
   }
20
 }
28
 }
21
 
29
 

+ 2
- 2
android/gradle.properties Näytä tiedosto

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

+ 270
- 30
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java Näytä tiedosto

5
 import android.app.Activity;
5
 import android.app.Activity;
6
 import android.app.DownloadManager;
6
 import android.app.DownloadManager;
7
 import android.content.Context;
7
 import android.content.Context;
8
-import android.content.Intent;
9
 import android.content.pm.ActivityInfo;
8
 import android.content.pm.ActivityInfo;
10
 import android.content.pm.PackageManager;
9
 import android.content.pm.PackageManager;
11
 import android.graphics.Bitmap;
10
 import android.graphics.Bitmap;
12
 import android.graphics.Color;
11
 import android.graphics.Color;
13
 import android.Manifest;
12
 import android.Manifest;
13
+import android.net.http.SslError;
14
 import android.net.Uri;
14
 import android.net.Uri;
15
 import android.os.Build;
15
 import android.os.Build;
16
 import android.os.Environment;
16
 import android.os.Environment;
17
-import androidx.annotation.RequiresApi;
18
-import androidx.core.content.ContextCompat;
17
+import android.os.SystemClock;
19
 import android.text.TextUtils;
18
 import android.text.TextUtils;
19
+import android.util.Log;
20
 import android.view.Gravity;
20
 import android.view.Gravity;
21
 import android.view.View;
21
 import android.view.View;
22
 import android.view.ViewGroup;
22
 import android.view.ViewGroup;
27
 import android.webkit.DownloadListener;
27
 import android.webkit.DownloadListener;
28
 import android.webkit.GeolocationPermissions;
28
 import android.webkit.GeolocationPermissions;
29
 import android.webkit.JavascriptInterface;
29
 import android.webkit.JavascriptInterface;
30
+import android.webkit.RenderProcessGoneDetail;
31
+import android.webkit.SslErrorHandler;
30
 import android.webkit.PermissionRequest;
32
 import android.webkit.PermissionRequest;
31
 import android.webkit.URLUtil;
33
 import android.webkit.URLUtil;
32
 import android.webkit.ValueCallback;
34
 import android.webkit.ValueCallback;
38
 import android.webkit.WebViewClient;
40
 import android.webkit.WebViewClient;
39
 import android.widget.FrameLayout;
41
 import android.widget.FrameLayout;
40
 
42
 
43
+import androidx.annotation.Nullable;
44
+import androidx.annotation.RequiresApi;
45
+import androidx.core.content.ContextCompat;
46
+import androidx.core.util.Pair;
47
+
48
+import com.facebook.common.logging.FLog;
41
 import com.facebook.react.modules.core.PermissionAwareActivity;
49
 import com.facebook.react.modules.core.PermissionAwareActivity;
42
 import com.facebook.react.modules.core.PermissionListener;
50
 import com.facebook.react.modules.core.PermissionListener;
43
 import com.facebook.react.views.scroll.ScrollEvent;
51
 import com.facebook.react.views.scroll.ScrollEvent;
63
 import com.facebook.react.uimanager.events.ContentSizeChangeEvent;
71
 import com.facebook.react.uimanager.events.ContentSizeChangeEvent;
64
 import com.facebook.react.uimanager.events.Event;
72
 import com.facebook.react.uimanager.events.Event;
65
 import com.facebook.react.uimanager.events.EventDispatcher;
73
 import com.facebook.react.uimanager.events.EventDispatcher;
74
+import com.reactnativecommunity.webview.RNCWebViewModule.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState;
66
 import com.reactnativecommunity.webview.events.TopLoadingErrorEvent;
75
 import com.reactnativecommunity.webview.events.TopLoadingErrorEvent;
67
 import com.reactnativecommunity.webview.events.TopHttpErrorEvent;
76
 import com.reactnativecommunity.webview.events.TopHttpErrorEvent;
68
 import com.reactnativecommunity.webview.events.TopLoadingFinishEvent;
77
 import com.reactnativecommunity.webview.events.TopLoadingFinishEvent;
70
 import com.reactnativecommunity.webview.events.TopLoadingStartEvent;
79
 import com.reactnativecommunity.webview.events.TopLoadingStartEvent;
71
 import com.reactnativecommunity.webview.events.TopMessageEvent;
80
 import com.reactnativecommunity.webview.events.TopMessageEvent;
72
 import com.reactnativecommunity.webview.events.TopShouldStartLoadWithRequestEvent;
81
 import com.reactnativecommunity.webview.events.TopShouldStartLoadWithRequestEvent;
82
+import com.reactnativecommunity.webview.events.TopRenderProcessGoneEvent;
73
 
83
 
74
 import org.json.JSONException;
84
 import org.json.JSONException;
75
 import org.json.JSONObject;
85
 import org.json.JSONObject;
84
 import java.util.List;
94
 import java.util.List;
85
 import java.util.Locale;
95
 import java.util.Locale;
86
 import java.util.Map;
96
 import java.util.Map;
87
-
88
-import javax.annotation.Nullable;
97
+import java.util.concurrent.atomic.AtomicReference;
89
 
98
 
90
 /**
99
 /**
91
  * Manages instances of {@link WebView}
100
  * Manages instances of {@link WebView}
113
  */
122
  */
114
 @ReactModule(name = RNCWebViewManager.REACT_CLASS)
123
 @ReactModule(name = RNCWebViewManager.REACT_CLASS)
115
 public class RNCWebViewManager extends SimpleViewManager<WebView> {
124
 public class RNCWebViewManager extends SimpleViewManager<WebView> {
125
+  private static final String TAG = "RNCWebViewManager";
116
 
126
 
117
-  public static String activeUrl = null;
118
   public static final int COMMAND_GO_BACK = 1;
127
   public static final int COMMAND_GO_BACK = 1;
119
   public static final int COMMAND_GO_FORWARD = 2;
128
   public static final int COMMAND_GO_FORWARD = 2;
120
   public static final int COMMAND_RELOAD = 3;
129
   public static final int COMMAND_RELOAD = 3;
137
   // Use `webView.loadUrl("about:blank")` to reliably reset the view
146
   // Use `webView.loadUrl("about:blank")` to reliably reset the view
138
   // state and release page resources (including any running JavaScript).
147
   // state and release page resources (including any running JavaScript).
139
   protected static final String BLANK_URL = "about:blank";
148
   protected static final String BLANK_URL = "about:blank";
149
+  protected static final int SHOULD_OVERRIDE_URL_LOADING_TIMEOUT = 250;
140
   protected WebViewConfig mWebViewConfig;
150
   protected WebViewConfig mWebViewConfig;
141
 
151
 
142
   protected RNCWebChromeClient mWebChromeClient = null;
152
   protected RNCWebChromeClient mWebChromeClient = null;
300
     }
310
     }
301
   }
311
   }
302
 
312
 
313
+  @ReactProp(name = "androidLayerType")
314
+  public void setLayerType(WebView view, String layerTypeString) {
315
+    int layerType = View.LAYER_TYPE_NONE;
316
+    switch (layerTypeString) {
317
+        case "hardware":
318
+          layerType = View.LAYER_TYPE_HARDWARE;
319
+          break;
320
+        case "software":
321
+          layerType = View.LAYER_TYPE_SOFTWARE;
322
+          break;
323
+    }
324
+    view.setLayerType(layerType, null);
325
+  }
326
+
327
+
303
   @ReactProp(name = "overScrollMode")
328
   @ReactProp(name = "overScrollMode")
304
   public void setOverScrollMode(WebView view, String overScrollModeString) {
329
   public void setOverScrollMode(WebView view, String overScrollModeString) {
305
     Integer overScrollMode;
330
     Integer overScrollMode;
381
     view.getSettings().setMediaPlaybackRequiresUserGesture(requires);
406
     view.getSettings().setMediaPlaybackRequiresUserGesture(requires);
382
   }
407
   }
383
 
408
 
409
+  @ReactProp(name = "javaScriptCanOpenWindowsAutomatically")
410
+  public void setJavaScriptCanOpenWindowsAutomatically(WebView view, boolean enabled) {
411
+    view.getSettings().setJavaScriptCanOpenWindowsAutomatically(enabled);
412
+  }
413
+
384
   @ReactProp(name = "allowFileAccessFromFileURLs")
414
   @ReactProp(name = "allowFileAccessFromFileURLs")
385
   public void setAllowFileAccessFromFileURLs(WebView view, boolean allow) {
415
   public void setAllowFileAccessFromFileURLs(WebView view, boolean allow) {
386
     view.getSettings().setAllowFileAccessFromFileURLs(allow);
416
     view.getSettings().setAllowFileAccessFromFileURLs(allow);
401
     ((RNCWebView) view).setInjectedJavaScript(injectedJavaScript);
431
     ((RNCWebView) view).setInjectedJavaScript(injectedJavaScript);
402
   }
432
   }
403
 
433
 
434
+  @ReactProp(name = "injectedJavaScriptBeforeContentLoaded")
435
+  public void setInjectedJavaScriptBeforeContentLoaded(WebView view, @Nullable String injectedJavaScriptBeforeContentLoaded) {
436
+    ((RNCWebView) view).setInjectedJavaScriptBeforeContentLoaded(injectedJavaScriptBeforeContentLoaded);
437
+  }
438
+
439
+  @ReactProp(name = "injectedJavaScriptForMainFrameOnly")
440
+  public void setInjectedJavaScriptForMainFrameOnly(WebView view, boolean enabled) {
441
+    ((RNCWebView) view).setInjectedJavaScriptForMainFrameOnly(enabled);
442
+  }
443
+
444
+  @ReactProp(name = "injectedJavaScriptBeforeContentLoadedForMainFrameOnly")
445
+  public void setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(WebView view, boolean enabled) {
446
+    ((RNCWebView) view).setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(enabled);
447
+  }
448
+
404
   @ReactProp(name = "messagingEnabled")
449
   @ReactProp(name = "messagingEnabled")
405
   public void setMessagingEnabled(WebView view, boolean enabled) {
450
   public void setMessagingEnabled(WebView view, boolean enabled) {
406
     ((RNCWebView) view).setMessagingEnabled(enabled);
451
     ((RNCWebView) view).setMessagingEnabled(enabled);
410
   public void setMessagingModuleName(WebView view, String moduleName) {
455
   public void setMessagingModuleName(WebView view, String moduleName) {
411
     ((RNCWebView) view).setMessagingModuleName(moduleName);
456
     ((RNCWebView) view).setMessagingModuleName(moduleName);
412
   }
457
   }
413
-   
458
+
414
   @ReactProp(name = "incognito")
459
   @ReactProp(name = "incognito")
415
   public void setIncognito(WebView view, boolean enabled) {
460
   public void setIncognito(WebView view, boolean enabled) {
461
+    // Don't do anything when incognito is disabled
462
+    if (!enabled) {
463
+      return;
464
+    }
465
+
416
     // Remove all previous cookies
466
     // Remove all previous cookies
417
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
467
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
418
       CookieManager.getInstance().removeAllCookies(null);
468
       CookieManager.getInstance().removeAllCookies(null);
422
 
472
 
423
     // Disable caching
473
     // Disable caching
424
     view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
474
     view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
425
-    view.getSettings().setAppCacheEnabled(!enabled);
475
+    view.getSettings().setAppCacheEnabled(false);
426
     view.clearHistory();
476
     view.clearHistory();
427
-    view.clearCache(enabled);
477
+    view.clearCache(true);
428
 
478
 
429
     // No form data or autofill enabled
479
     // No form data or autofill enabled
430
     view.clearFormData();
480
     view.clearFormData();
431
-    view.getSettings().setSavePassword(!enabled);
432
-    view.getSettings().setSaveFormData(!enabled);
481
+    view.getSettings().setSavePassword(false);
482
+    view.getSettings().setSaveFormData(false);
433
   }
483
   }
434
 
484
 
435
   @ReactProp(name = "source")
485
   @ReactProp(name = "source")
559
     export.put(TopShouldStartLoadWithRequestEvent.EVENT_NAME, MapBuilder.of("registrationName", "onShouldStartLoadWithRequest"));
609
     export.put(TopShouldStartLoadWithRequestEvent.EVENT_NAME, MapBuilder.of("registrationName", "onShouldStartLoadWithRequest"));
560
     export.put(ScrollEventType.getJSEventName(ScrollEventType.SCROLL), MapBuilder.of("registrationName", "onScroll"));
610
     export.put(ScrollEventType.getJSEventName(ScrollEventType.SCROLL), MapBuilder.of("registrationName", "onScroll"));
561
     export.put(TopHttpErrorEvent.EVENT_NAME, MapBuilder.of("registrationName", "onHttpError"));
611
     export.put(TopHttpErrorEvent.EVENT_NAME, MapBuilder.of("registrationName", "onHttpError"));
612
+    export.put(TopRenderProcessGoneEvent.EVENT_NAME, MapBuilder.of("registrationName", "onRenderProcessGone"));
562
     return export;
613
     return export;
563
   }
614
   }
564
 
615
 
623
         if (args == null) {
674
         if (args == null) {
624
           throw new RuntimeException("Arguments for loading an url are null!");
675
           throw new RuntimeException("Arguments for loading an url are null!");
625
         }
676
         }
677
+        ((RNCWebView) root).progressChangedFilter.setWaitingForCommandLoadUrl(false);
626
         root.loadUrl(args.getString(0));
678
         root.loadUrl(args.getString(0));
627
         break;
679
         break;
628
       case COMMAND_FOCUS:
680
       case COMMAND_FOCUS:
660
         public Bitmap getDefaultVideoPoster() {
712
         public Bitmap getDefaultVideoPoster() {
661
           return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
713
           return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888);
662
         }
714
         }
663
-        
715
+
664
         @Override
716
         @Override
665
         public void onShowCustomView(View view, CustomViewCallback callback) {
717
         public void onShowCustomView(View view, CustomViewCallback callback) {
666
           if (mVideoView != null) {
718
           if (mVideoView != null) {
728
     protected boolean mLastLoadFailed = false;
780
     protected boolean mLastLoadFailed = false;
729
     protected @Nullable
781
     protected @Nullable
730
     ReadableArray mUrlPrefixesForDefaultIntent;
782
     ReadableArray mUrlPrefixesForDefaultIntent;
783
+    protected RNCWebView.ProgressChangedFilter progressChangedFilter = null;
731
     protected @Nullable String ignoreErrFailedForThisURL = null;
784
     protected @Nullable String ignoreErrFailedForThisURL = null;
732
 
785
 
733
     public void setIgnoreErrFailedForThisURL(@Nullable String url) {
786
     public void setIgnoreErrFailedForThisURL(@Nullable String url) {
752
       super.onPageStarted(webView, url, favicon);
805
       super.onPageStarted(webView, url, favicon);
753
       mLastLoadFailed = false;
806
       mLastLoadFailed = false;
754
 
807
 
808
+      RNCWebView reactWebView = (RNCWebView) webView;
809
+      reactWebView.callInjectedJavaScriptBeforeContentLoaded();
810
+
755
       dispatchEvent(
811
       dispatchEvent(
756
         webView,
812
         webView,
757
         new TopLoadingStartEvent(
813
         new TopLoadingStartEvent(
761
 
817
 
762
     @Override
818
     @Override
763
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
819
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
764
-      activeUrl = url;
765
-      dispatchEvent(
766
-        view,
767
-        new TopShouldStartLoadWithRequestEvent(
768
-          view.getId(),
769
-          createWebViewEvent(view, url)));
770
-      return true;
771
-    }
820
+      final RNCWebView rncWebView = (RNCWebView) view;
821
+      final boolean isJsDebugging = ((ReactContext) view.getContext()).getJavaScriptContextHolder().get() == 0;
822
+
823
+      if (!isJsDebugging && rncWebView.mCatalystInstance != null) {
824
+        final Pair<Integer, AtomicReference<ShouldOverrideCallbackState>> lock = RNCWebViewModule.shouldOverrideUrlLoadingLock.getNewLock();
825
+        final int lockIdentifier = lock.first;
826
+        final AtomicReference<ShouldOverrideCallbackState> lockObject = lock.second;
827
+
828
+        final WritableMap event = createWebViewEvent(view, url);
829
+        event.putInt("lockIdentifier", lockIdentifier);
830
+        rncWebView.sendDirectMessage("onShouldStartLoadWithRequest", event);
831
+
832
+        try {
833
+          assert lockObject != null;
834
+          synchronized (lockObject) {
835
+            final long startTime = SystemClock.elapsedRealtime();
836
+            while (lockObject.get() == ShouldOverrideCallbackState.UNDECIDED) {
837
+              if (SystemClock.elapsedRealtime() - startTime > SHOULD_OVERRIDE_URL_LOADING_TIMEOUT) {
838
+                FLog.w(TAG, "Did not receive response to shouldOverrideUrlLoading in time, defaulting to allow loading.");
839
+                RNCWebViewModule.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
840
+                return false;
841
+              }
842
+              lockObject.wait(SHOULD_OVERRIDE_URL_LOADING_TIMEOUT);
843
+            }
844
+          }
845
+        } catch (InterruptedException e) {
846
+          FLog.e(TAG, "shouldOverrideUrlLoading was interrupted while waiting for result.", e);
847
+          RNCWebViewModule.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
848
+          return false;
849
+        }
772
 
850
 
851
+        final boolean shouldOverride = lockObject.get() == ShouldOverrideCallbackState.SHOULD_OVERRIDE;
852
+        RNCWebViewModule.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
853
+
854
+        return shouldOverride;
855
+      } else {
856
+        FLog.w(TAG, "Couldn't use blocking synchronous call for onShouldStartLoadWithRequest due to debugging or missing Catalyst instance, falling back to old event-and-load.");
857
+        progressChangedFilter.setWaitingForCommandLoadUrl(true);
858
+        dispatchEvent(
859
+          view,
860
+          new TopShouldStartLoadWithRequestEvent(
861
+            view.getId(),
862
+            createWebViewEvent(view, url)));
863
+        return true;
864
+      }
865
+    }
773
 
866
 
774
     @TargetApi(Build.VERSION_CODES.N)
867
     @TargetApi(Build.VERSION_CODES.N)
775
     @Override
868
     @Override
778
       return this.shouldOverrideUrlLoading(view, url);
871
       return this.shouldOverrideUrlLoading(view, url);
779
     }
872
     }
780
 
873
 
874
+    @Override
875
+    public void onReceivedSslError(final WebView webView, final SslErrorHandler handler, final SslError error) {
876
+        handler.cancel();
877
+
878
+        int code = error.getPrimaryError();
879
+        String failingUrl = error.getUrl();
880
+        String description = "";
881
+        String descriptionPrefix = "SSL error: ";
882
+
883
+        // https://developer.android.com/reference/android/net/http/SslError.html
884
+        switch (code) {
885
+          case SslError.SSL_DATE_INVALID:
886
+            description = "The date of the certificate is invalid";
887
+            break;
888
+          case SslError.SSL_EXPIRED:
889
+            description = "The certificate has expired";
890
+            break;
891
+          case SslError.SSL_IDMISMATCH:
892
+            description = "Hostname mismatch";
893
+            break;
894
+          case SslError.SSL_INVALID:
895
+            description = "A generic error occurred";
896
+            break;
897
+          case SslError.SSL_NOTYETVALID:
898
+            description = "The certificate is not yet valid";
899
+            break;
900
+          case SslError.SSL_UNTRUSTED:
901
+            description = "The certificate authority is not trusted";
902
+            break;
903
+          default:
904
+            description = "Unknown SSL Error";
905
+            break;
906
+        }
907
+
908
+        description = descriptionPrefix + description;
909
+
910
+        this.onReceivedError(
911
+          webView,
912
+          code,
913
+          description,
914
+          failingUrl
915
+        );
916
+    }
917
+
781
     @Override
918
     @Override
782
     public void onReceivedError(
919
     public void onReceivedError(
783
       WebView webView,
920
       WebView webView,
834
       }
971
       }
835
     }
972
     }
836
 
973
 
974
+    @TargetApi(Build.VERSION_CODES.O)
975
+    @Override
976
+    public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail detail) {
977
+        // WebViewClient.onRenderProcessGone was added in O.
978
+        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
979
+            return false;
980
+        }
981
+        super.onRenderProcessGone(webView, detail);
982
+
983
+        if(detail.didCrash()){
984
+          Log.e("RNCWebViewManager", "The WebView rendering process crashed.");
985
+        }
986
+        else{
987
+          Log.w("RNCWebViewManager", "The WebView rendering process was killed by the system.");
988
+        }
989
+
990
+        // if webView is null, we cannot return any event
991
+        // since the view is already dead/disposed
992
+        // still prevent the app crash by returning true.
993
+        if(webView == null){
994
+          return true;
995
+        }
996
+
997
+        WritableMap event = createWebViewEvent(webView, webView.getUrl());
998
+        event.putBoolean("didCrash", detail.didCrash());
999
+
1000
+        dispatchEvent(
1001
+          webView,
1002
+          new TopRenderProcessGoneEvent(webView.getId(), event)
1003
+        );
1004
+
1005
+        // returning false would crash the app.
1006
+        return true;
1007
+    }
1008
+
837
     protected void emitFinishEvent(WebView webView, String url) {
1009
     protected void emitFinishEvent(WebView webView, String url) {
838
       dispatchEvent(
1010
       dispatchEvent(
839
         webView,
1011
         webView,
858
     public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {
1030
     public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {
859
       mUrlPrefixesForDefaultIntent = specialUrls;
1031
       mUrlPrefixesForDefaultIntent = specialUrls;
860
     }
1032
     }
1033
+
1034
+    public void setProgressChangedFilter(RNCWebView.ProgressChangedFilter filter) {
1035
+      progressChangedFilter = filter;
1036
+    }
861
   }
1037
   }
862
 
1038
 
863
   protected static class RNCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
1039
   protected static class RNCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
902
     // Pending Android permissions for the next request
1078
     // Pending Android permissions for the next request
903
     protected ArrayList<String> pendingPermissions = new ArrayList<>();
1079
     protected ArrayList<String> pendingPermissions = new ArrayList<>();
904
 
1080
 
1081
+    protected RNCWebView.ProgressChangedFilter progressChangedFilter = null;
905
 
1082
 
906
     public RNCWebChromeClient(ReactContext reactContext, WebView webView) {
1083
     public RNCWebChromeClient(ReactContext reactContext, WebView webView) {
907
       this.mReactContext = reactContext;
1084
       this.mReactContext = reactContext;
921
     public void onProgressChanged(WebView webView, int newProgress) {
1098
     public void onProgressChanged(WebView webView, int newProgress) {
922
       super.onProgressChanged(webView, newProgress);
1099
       super.onProgressChanged(webView, newProgress);
923
       final String url = webView.getUrl();
1100
       final String url = webView.getUrl();
924
-      if (
925
-        url != null
926
-        && activeUrl != null
927
-        && !url.equals(activeUrl)
928
-      ) {
1101
+      if (progressChangedFilter.isWaitingForCommandLoadUrl()) {
929
         return;
1102
         return;
930
       }
1103
       }
931
       WritableMap event = Arguments.createMap();
1104
       WritableMap event = Arguments.createMap();
1136
     protected ViewGroup getRootView() {
1309
     protected ViewGroup getRootView() {
1137
       return (ViewGroup) mReactContext.getCurrentActivity().findViewById(android.R.id.content);
1310
       return (ViewGroup) mReactContext.getCurrentActivity().findViewById(android.R.id.content);
1138
     }
1311
     }
1312
+
1313
+    public void setProgressChangedFilter(RNCWebView.ProgressChangedFilter filter) {
1314
+      progressChangedFilter = filter;
1315
+    }
1139
   }
1316
   }
1140
 
1317
 
1141
   /**
1318
   /**
1145
   protected static class RNCWebView extends WebView implements LifecycleEventListener {
1322
   protected static class RNCWebView extends WebView implements LifecycleEventListener {
1146
     protected @Nullable
1323
     protected @Nullable
1147
     String injectedJS;
1324
     String injectedJS;
1325
+    protected @Nullable
1326
+    String injectedJSBeforeContentLoaded;
1327
+
1328
+    /**
1329
+     * android.webkit.WebChromeClient fundamentally does not support JS injection into frames other
1330
+     * than the main frame, so these two properties are mostly here just for parity with iOS & macOS.
1331
+     */
1332
+    protected boolean injectedJavaScriptForMainFrameOnly = true;
1333
+    protected boolean injectedJavaScriptBeforeContentLoadedForMainFrameOnly = true;
1334
+
1148
     protected boolean messagingEnabled = false;
1335
     protected boolean messagingEnabled = false;
1149
     protected @Nullable
1336
     protected @Nullable
1150
     String messagingModuleName;
1337
     String messagingModuleName;
1155
     protected boolean sendContentSizeChangeEvents = false;
1342
     protected boolean sendContentSizeChangeEvents = false;
1156
     private OnScrollDispatchHelper mOnScrollDispatchHelper;
1343
     private OnScrollDispatchHelper mOnScrollDispatchHelper;
1157
     protected boolean hasScrollEvent = false;
1344
     protected boolean hasScrollEvent = false;
1345
+    protected ProgressChangedFilter progressChangedFilter;
1158
 
1346
 
1159
     /**
1347
     /**
1160
      * WebView must be created with an context of the current activity
1348
      * WebView must be created with an context of the current activity
1164
      */
1352
      */
1165
     public RNCWebView(ThemedReactContext reactContext) {
1353
     public RNCWebView(ThemedReactContext reactContext) {
1166
       super(reactContext);
1354
       super(reactContext);
1355
+      this.createCatalystInstance();
1356
+      progressChangedFilter = new ProgressChangedFilter();
1167
     }
1357
     }
1168
 
1358
 
1169
     public void setIgnoreErrFailedForThisURL(String url) {
1359
     public void setIgnoreErrFailedForThisURL(String url) {
1214
       super.setWebViewClient(client);
1404
       super.setWebViewClient(client);
1215
       if (client instanceof RNCWebViewClient) {
1405
       if (client instanceof RNCWebViewClient) {
1216
         mRNCWebViewClient = (RNCWebViewClient) client;
1406
         mRNCWebViewClient = (RNCWebViewClient) client;
1407
+        mRNCWebViewClient.setProgressChangedFilter(progressChangedFilter);
1408
+      }
1409
+    }
1410
+
1411
+    WebChromeClient mWebChromeClient;
1412
+    @Override
1413
+    public void setWebChromeClient(WebChromeClient client) {
1414
+      this.mWebChromeClient = client;
1415
+      super.setWebChromeClient(client);
1416
+      if (client instanceof RNCWebChromeClient) {
1417
+        ((RNCWebChromeClient) client).setProgressChangedFilter(progressChangedFilter);
1217
       }
1418
       }
1218
     }
1419
     }
1219
 
1420
 
1226
       injectedJS = js;
1427
       injectedJS = js;
1227
     }
1428
     }
1228
 
1429
 
1430
+    public void setInjectedJavaScriptBeforeContentLoaded(@Nullable String js) {
1431
+      injectedJSBeforeContentLoaded = js;
1432
+    }
1433
+
1434
+    public void setInjectedJavaScriptForMainFrameOnly(boolean enabled) {
1435
+      injectedJavaScriptForMainFrameOnly = enabled;
1436
+    }
1437
+
1438
+    public void setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(boolean enabled) {
1439
+      injectedJavaScriptBeforeContentLoadedForMainFrameOnly = enabled;
1440
+    }
1441
+
1229
     protected RNCWebViewBridge createRNCWebViewBridge(RNCWebView webView) {
1442
     protected RNCWebViewBridge createRNCWebViewBridge(RNCWebView webView) {
1230
       return new RNCWebViewBridge(webView);
1443
       return new RNCWebViewBridge(webView);
1231
     }
1444
     }
1248
 
1461
 
1249
       if (enabled) {
1462
       if (enabled) {
1250
         addJavascriptInterface(createRNCWebViewBridge(this), JAVASCRIPT_INTERFACE);
1463
         addJavascriptInterface(createRNCWebViewBridge(this), JAVASCRIPT_INTERFACE);
1251
-        this.createCatalystInstance();
1252
       } else {
1464
       } else {
1253
         removeJavascriptInterface(JAVASCRIPT_INTERFACE);
1465
         removeJavascriptInterface(JAVASCRIPT_INTERFACE);
1254
       }
1466
       }
1280
       }
1492
       }
1281
     }
1493
     }
1282
 
1494
 
1495
+    public void callInjectedJavaScriptBeforeContentLoaded() {
1496
+      if (getSettings().getJavaScriptEnabled() &&
1497
+      injectedJSBeforeContentLoaded != null &&
1498
+      !TextUtils.isEmpty(injectedJSBeforeContentLoaded)) {
1499
+        evaluateJavascriptWithFallback("(function() {\n" + injectedJSBeforeContentLoaded + ";\n})();");
1500
+      }
1501
+    }
1502
+
1283
     public void onMessage(String message) {
1503
     public void onMessage(String message) {
1284
       ReactContext reactContext = (ReactContext) this.getContext();
1504
       ReactContext reactContext = (ReactContext) this.getContext();
1285
       RNCWebView mContext = this;
1505
       RNCWebView mContext = this;
1296
             data.putString("data", message);
1516
             data.putString("data", message);
1297
 
1517
 
1298
             if (mCatalystInstance != null) {
1518
             if (mCatalystInstance != null) {
1299
-              mContext.sendDirectMessage(data);
1519
+              mContext.sendDirectMessage("onMessage", data);
1300
             } else {
1520
             } else {
1301
               dispatchEvent(webView, new TopMessageEvent(webView.getId(), data));
1521
               dispatchEvent(webView, new TopMessageEvent(webView.getId(), data));
1302
             }
1522
             }
1307
         eventData.putString("data", message);
1527
         eventData.putString("data", message);
1308
 
1528
 
1309
         if (mCatalystInstance != null) {
1529
         if (mCatalystInstance != null) {
1310
-          this.sendDirectMessage(eventData);
1530
+          this.sendDirectMessage("onMessage", eventData);
1311
         } else {
1531
         } else {
1312
           dispatchEvent(this, new TopMessageEvent(this.getId(), eventData));
1532
           dispatchEvent(this, new TopMessageEvent(this.getId(), eventData));
1313
         }
1533
         }
1314
       }
1534
       }
1315
     }
1535
     }
1316
 
1536
 
1317
-    protected void sendDirectMessage(WritableMap data) {
1537
+    protected void sendDirectMessage(final String method, WritableMap data) {
1318
       WritableNativeMap event = new WritableNativeMap();
1538
       WritableNativeMap event = new WritableNativeMap();
1319
       event.putMap("nativeEvent", data);
1539
       event.putMap("nativeEvent", data);
1320
 
1540
 
1321
       WritableNativeArray params = new WritableNativeArray();
1541
       WritableNativeArray params = new WritableNativeArray();
1322
       params.pushMap(event);
1542
       params.pushMap(event);
1323
 
1543
 
1324
-      mCatalystInstance.callFunction(messagingModuleName, "onMessage", params);
1544
+      mCatalystInstance.callFunction(messagingModuleName, method, params);
1325
     }
1545
     }
1326
 
1546
 
1327
     protected void onScrollChanged(int x, int y, int oldX, int oldY) {
1547
     protected void onScrollChanged(int x, int y, int oldX, int oldY) {
1357
       destroy();
1577
       destroy();
1358
     }
1578
     }
1359
 
1579
 
1580
+    @Override
1581
+    public void destroy() {
1582
+      if (mWebChromeClient != null) {
1583
+        mWebChromeClient.onHideCustomView();
1584
+      }
1585
+      super.destroy();
1586
+    }
1587
+
1360
     protected class RNCWebViewBridge {
1588
     protected class RNCWebViewBridge {
1361
       RNCWebView mContext;
1589
       RNCWebView mContext;
1362
 
1590
 
1373
         mContext.onMessage(message);
1601
         mContext.onMessage(message);
1374
       }
1602
       }
1375
     }
1603
     }
1604
+
1605
+    protected static class ProgressChangedFilter {
1606
+      private boolean waitingForCommandLoadUrl = false;
1607
+
1608
+      public void setWaitingForCommandLoadUrl(boolean isWaiting) {
1609
+        waitingForCommandLoadUrl = isWaiting;
1610
+      }
1611
+
1612
+      public boolean isWaitingForCommandLoadUrl() {
1613
+        return waitingForCommandLoadUrl;
1614
+      }
1615
+    }
1376
   }
1616
   }
1377
 }
1617
 }

+ 48
- 7
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewModule.java Näytä tiedosto

12
 import android.os.Parcelable;
12
 import android.os.Parcelable;
13
 import android.provider.MediaStore;
13
 import android.provider.MediaStore;
14
 
14
 
15
+import androidx.annotation.Nullable;
15
 import androidx.annotation.RequiresApi;
16
 import androidx.annotation.RequiresApi;
16
 import androidx.core.content.ContextCompat;
17
 import androidx.core.content.ContextCompat;
17
 import androidx.core.content.FileProvider;
18
 import androidx.core.content.FileProvider;
19
+import androidx.core.util.Pair;
18
 
20
 
19
 import android.util.Log;
21
 import android.util.Log;
20
 import android.webkit.MimeTypeMap;
22
 import android.webkit.MimeTypeMap;
35
 import java.io.IOException;
37
 import java.io.IOException;
36
 import java.util.ArrayList;
38
 import java.util.ArrayList;
37
 import java.util.Arrays;
39
 import java.util.Arrays;
40
+import java.util.HashMap;
41
+import java.util.concurrent.atomic.AtomicReference;
38
 
42
 
39
 import static android.app.Activity.RESULT_OK;
43
 import static android.app.Activity.RESULT_OK;
40
 
44
 
50
   private File outputVideo;
54
   private File outputVideo;
51
   private DownloadManager.Request downloadRequest;
55
   private DownloadManager.Request downloadRequest;
52
 
56
 
57
+  protected static class ShouldOverrideUrlLoadingLock {
58
+    protected enum ShouldOverrideCallbackState {
59
+      UNDECIDED,
60
+      SHOULD_OVERRIDE,
61
+      DO_NOT_OVERRIDE,
62
+    }
63
+
64
+    private int nextLockIdentifier = 0;
65
+    private final HashMap<Integer, AtomicReference<ShouldOverrideCallbackState>> shouldOverrideLocks = new HashMap<>();
66
+
67
+    public synchronized Pair<Integer, AtomicReference<ShouldOverrideCallbackState>> getNewLock() {
68
+      final int lockIdentifier = nextLockIdentifier++;
69
+      final AtomicReference<ShouldOverrideCallbackState> shouldOverride = new AtomicReference<>(ShouldOverrideCallbackState.UNDECIDED);
70
+      shouldOverrideLocks.put(lockIdentifier, shouldOverride);
71
+      return new Pair<>(lockIdentifier, shouldOverride);
72
+    }
73
+
74
+    @Nullable
75
+    public synchronized AtomicReference<ShouldOverrideCallbackState> getLock(Integer lockIdentifier) {
76
+      return shouldOverrideLocks.get(lockIdentifier);
77
+    }
78
+
79
+    public synchronized void removeLock(Integer lockIdentifier) {
80
+      shouldOverrideLocks.remove(lockIdentifier);
81
+    }
82
+  }
83
+
84
+  protected static final ShouldOverrideUrlLoadingLock shouldOverrideUrlLoadingLock = new ShouldOverrideUrlLoadingLock();
85
+
53
   private enum MimeType {
86
   private enum MimeType {
54
     DEFAULT("*/*"),
87
     DEFAULT("*/*"),
55
     IMAGE("image"),
88
     IMAGE("image"),
105
     promise.resolve(result);
138
     promise.resolve(result);
106
   }
139
   }
107
 
140
 
141
+  @ReactMethod(isBlockingSynchronousMethod = true)
142
+  public void onShouldStartLoadWithRequestCallback(final boolean shouldStart, final int lockIdentifier) {
143
+    final AtomicReference<ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState> lockObject = shouldOverrideUrlLoadingLock.getLock(lockIdentifier);
144
+    if (lockObject != null) {
145
+      synchronized (lockObject) {
146
+        lockObject.set(shouldStart ? ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.DO_NOT_OVERRIDE : ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.SHOULD_OVERRIDE);
147
+        lockObject.notify();
148
+      }
149
+    }
150
+  }
151
+
108
   public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
152
   public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
109
 
153
 
110
     if (filePathCallback == null && filePathCallbackLegacy == null) {
154
     if (filePathCallback == null && filePathCallbackLegacy == null) {
272
   }
316
   }
273
 
317
 
274
   public boolean grantFileDownloaderPermissions() {
318
   public boolean grantFileDownloaderPermissions() {
275
-    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
319
+    // Permission not required for Android Q and above
320
+    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
276
       return true;
321
       return true;
277
     }
322
     }
278
 
323
 
279
-    boolean result = true;
280
-    if (ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
281
-      result = false;
282
-    }
283
-
284
-    if (!result) {
324
+    boolean result = ContextCompat.checkSelfPermission(getCurrentActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
325
+    if (!result && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
285
       PermissionAwareActivity activity = getPermissionAwareActivity();
326
       PermissionAwareActivity activity = getPermissionAwareActivity();
286
       activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, FILE_DOWNLOAD_PERMISSION_REQUEST, webviewFileDownloaderPermissionListener);
327
       activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, FILE_DOWNLOAD_PERMISSION_REQUEST, webviewFileDownloaderPermissionListener);
287
     }
328
     }

+ 26
- 0
android/src/main/java/com/reactnativecommunity/webview/events/TopRenderProcessGoneEvent.kt Näytä tiedosto

1
+package com.reactnativecommunity.webview.events
2
+
3
+import com.facebook.react.bridge.WritableMap
4
+import com.facebook.react.uimanager.events.Event
5
+import com.facebook.react.uimanager.events.RCTEventEmitter
6
+
7
+/**
8
+ * Event emitted when the WebView's process has crashed or
9
+   was killed by the OS.
10
+ */
11
+class TopRenderProcessGoneEvent(viewId: Int, private val mEventData: WritableMap) :
12
+  Event<TopRenderProcessGoneEvent>(viewId) {
13
+  companion object {
14
+    const val EVENT_NAME = "topRenderProcessGone"
15
+  }
16
+
17
+  override fun getEventName(): String = EVENT_NAME
18
+
19
+  override fun canCoalesce(): Boolean = false
20
+
21
+  override fun getCoalescingKey(): Short = 0
22
+
23
+  override fun dispatch(rctEventEmitter: RCTEventEmitter) =
24
+    rctEventEmitter.receiveEvent(viewTag, eventName, mEventData)
25
+
26
+}

+ 2
- 0
android/src/main/java/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.kt Näytä tiedosto

14
 
14
 
15
   init {
15
   init {
16
     mData.putString("navigationType", "other")
16
     mData.putString("navigationType", "other")
17
+    // Android does not raise shouldOverrideUrlLoading for inner frames
18
+    mData.putBoolean("isTopFrame", true)
17
   }
19
   }
18
 
20
 
19
   override fun getEventName(): String = EVENT_NAME
21
   override fun getEventName(): String = EVENT_NAME

+ 10
- 0
apple/RNCWebView.h Näytä tiedosto

35
 @property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
35
 @property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
36
 @property (nonatomic, assign) BOOL scrollEnabled;
36
 @property (nonatomic, assign) BOOL scrollEnabled;
37
 @property (nonatomic, assign) BOOL sharedCookiesEnabled;
37
 @property (nonatomic, assign) BOOL sharedCookiesEnabled;
38
+@property (nonatomic, assign) BOOL autoManageStatusBarEnabled;
38
 @property (nonatomic, assign) BOOL pagingEnabled;
39
 @property (nonatomic, assign) BOOL pagingEnabled;
39
 @property (nonatomic, assign) CGFloat decelerationRate;
40
 @property (nonatomic, assign) CGFloat decelerationRate;
40
 @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
41
 @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
54
 @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
55
 @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent;
55
 @property (nonatomic, assign) BOOL cacheEnabled;
56
 @property (nonatomic, assign) BOOL cacheEnabled;
56
 @property (nonatomic, assign) BOOL javaScriptEnabled;
57
 @property (nonatomic, assign) BOOL javaScriptEnabled;
58
+@property (nonatomic, assign) BOOL javaScriptCanOpenWindowsAutomatically;
57
 @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
59
 @property (nonatomic, assign) BOOL allowFileAccessFromFileURLs;
58
 @property (nonatomic, assign) BOOL allowsLinkPreview;
60
 @property (nonatomic, assign) BOOL allowsLinkPreview;
59
 @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
61
 @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator;
61
 @property (nonatomic, assign) BOOL directionalLockEnabled;
63
 @property (nonatomic, assign) BOOL directionalLockEnabled;
62
 @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
64
 @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch;
63
 @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
65
 @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL;
66
+@property (nonatomic, assign) BOOL pullToRefreshEnabled;
67
+@property (nonatomic, weak) UIRefreshControl * refreshControl;
68
+
69
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
70
+@property (nonatomic, assign) WKContentMode contentMode;
71
+#endif
64
 
72
 
65
 + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
73
 + (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential;
66
 + (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
74
 + (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates;
70
 - (void)goBack;
78
 - (void)goBack;
71
 - (void)reload;
79
 - (void)reload;
72
 - (void)stopLoading;
80
 - (void)stopLoading;
81
+- (void)addPullToRefreshControl;
82
+- (void)pullToRefresh:(UIRefreshControl *)refreshControl;
73
 
83
 
74
 @end
84
 @end

+ 62
- 40
apple/RNCWebView.m Näytä tiedosto

125
     _showsVerticalScrollIndicator = YES;
125
     _showsVerticalScrollIndicator = YES;
126
     _directionalLockEnabled = YES;
126
     _directionalLockEnabled = YES;
127
     _automaticallyAdjustContentInsets = YES;
127
     _automaticallyAdjustContentInsets = YES;
128
+    _autoManageStatusBarEnabled = YES;
128
     _contentInset = UIEdgeInsetsZero;
129
     _contentInset = UIEdgeInsetsZero;
129
     _savedKeyboardDisplayRequiresUserAction = YES;
130
     _savedKeyboardDisplayRequiresUserAction = YES;
130
     #if !TARGET_OS_OSX
131
     #if !TARGET_OS_OSX
209
     [prefs setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
210
     [prefs setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
210
     _prefsUsed = YES;
211
     _prefsUsed = YES;
211
   }
212
   }
213
+  if (_javaScriptCanOpenWindowsAutomatically) {
214
+    [prefs setValue:@TRUE forKey:@"javaScriptCanOpenWindowsAutomatically"];
215
+    _prefsUsed = YES;
216
+  }
212
   if (_prefsUsed) {
217
   if (_prefsUsed) {
213
     wkWebViewConfig.preferences = prefs;
218
     wkWebViewConfig.preferences = prefs;
214
   }
219
   }
222
   }
227
   }
223
   wkWebViewConfig.userContentController = [WKUserContentController new];
228
   wkWebViewConfig.userContentController = [WKUserContentController new];
224
 
229
 
230
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
231
+  if (@available(iOS 13.0, *)) {
232
+    WKWebpagePreferences *pagePrefs = [[WKWebpagePreferences alloc]init];
233
+    pagePrefs.preferredContentMode = _contentMode;
234
+    wkWebViewConfig.defaultWebpagePreferences = pagePrefs;
235
+  }
236
+#endif
237
+
225
   // Shim the HTML5 history API:
238
   // Shim the HTML5 history API:
226
   [wkWebViewConfig.userContentController addScriptMessageHandler:[[RNCWeakScriptMessageDelegate alloc] initWithDelegate:self]
239
   [wkWebViewConfig.userContentController addScriptMessageHandler:[[RNCWeakScriptMessageDelegate alloc] initWithDelegate:self]
227
                                                             name:HistoryShimName];
240
                                                             name:HistoryShimName];
263
     _webView.UIDelegate = self;
276
     _webView.UIDelegate = self;
264
     _webView.navigationDelegate = self;
277
     _webView.navigationDelegate = self;
265
 #if !TARGET_OS_OSX
278
 #if !TARGET_OS_OSX
279
+    if (_pullToRefreshEnabled) {
280
+        [self addPullToRefreshControl];
281
+    }
266
     _webView.scrollView.scrollEnabled = _scrollEnabled;
282
     _webView.scrollView.scrollEnabled = _scrollEnabled;
267
     _webView.scrollView.pagingEnabled = _pagingEnabled;
283
     _webView.scrollView.pagingEnabled = _pagingEnabled;
268
-    _webView.scrollView.bounces = _bounces;
284
+      //For UIRefreshControl to work correctly, the bounces should always be true
285
+    _webView.scrollView.bounces = _pullToRefreshEnabled || _bounces; 
269
     _webView.scrollView.showsHorizontalScrollIndicator = _showsHorizontalScrollIndicator;
286
     _webView.scrollView.showsHorizontalScrollIndicator = _showsHorizontalScrollIndicator;
270
     _webView.scrollView.showsVerticalScrollIndicator = _showsVerticalScrollIndicator;
287
     _webView.scrollView.showsVerticalScrollIndicator = _showsVerticalScrollIndicator;
271
     _webView.scrollView.directionalLockEnabled = _directionalLockEnabled;
288
     _webView.scrollView.directionalLockEnabled = _directionalLockEnabled;
296
   _webView.allowsBackForwardNavigationGestures = _allowsBackForwardNavigationGestures;
313
   _webView.allowsBackForwardNavigationGestures = _allowsBackForwardNavigationGestures;
297
 }
314
 }
298
 
315
 
299
-
300
 - (void)removeFromSuperview
316
 - (void)removeFromSuperview
301
 {
317
 {
302
     if (_webView) {
318
     if (_webView) {
320
 -(void)showFullScreenVideoStatusBars
336
 -(void)showFullScreenVideoStatusBars
321
 {
337
 {
322
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
338
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
339
+    if (!_autoManageStatusBarEnabled) {
340
+      return;
341
+    }
342
+
323
     _isFullScreenVideoOpen = YES;
343
     _isFullScreenVideoOpen = YES;
324
     RCTUnsafeExecuteOnMainQueueSync(^{
344
     RCTUnsafeExecuteOnMainQueueSync(^{
325
-      [RCTSharedApplication() setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
345
+      [RCTSharedApplication() setStatusBarStyle:self->_savedStatusBarStyle animated:YES];
326
     });
346
     });
327
 #pragma clang diagnostic pop
347
 #pragma clang diagnostic pop
328
 }
348
 }
330
 -(void)hideFullScreenVideoStatusBars
350
 -(void)hideFullScreenVideoStatusBars
331
 {
351
 {
332
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
352
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
353
+    if (!_autoManageStatusBarEnabled) {
354
+      return;
355
+    }
356
+
333
     _isFullScreenVideoOpen = NO;
357
     _isFullScreenVideoOpen = NO;
334
     RCTUnsafeExecuteOnMainQueueSync(^{
358
     RCTUnsafeExecuteOnMainQueueSync(^{
335
       [RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES];
359
       [RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES];
865
  * topViewController
889
  * topViewController
866
  */
890
  */
867
 -(UIViewController *)topViewController{
891
 -(UIViewController *)topViewController{
868
-    UIViewController *controller = [self topViewControllerWithRootViewController:[self getCurrentWindow].rootViewController];
869
-    return controller;
892
+    return RCTPresentedViewController();
870
 }
893
 }
871
 
894
 
872
-/**
873
- * topViewControllerWithRootViewController
874
- */
875
--(UIViewController *)topViewControllerWithRootViewController:(UIViewController *)viewController{
876
-  if (viewController==nil) return nil;
877
-  if (viewController.presentedViewController!=nil) {
878
-    return [self topViewControllerWithRootViewController:viewController.presentedViewController];
879
-  } else if ([viewController isKindOfClass:[UITabBarController class]]){
880
-    return [self topViewControllerWithRootViewController:[(UITabBarController *)viewController selectedViewController]];
881
-  } else if ([viewController isKindOfClass:[UINavigationController class]]){
882
-    return [self topViewControllerWithRootViewController:[(UINavigationController *)viewController visibleViewController]];
883
-  } else {
884
-    return viewController;
885
-  }
886
-}
887
-/**
888
- * getCurrentWindow
889
- */
890
--(UIWindow *)getCurrentWindow{
891
-  UIWindow *window = [UIApplication sharedApplication].keyWindow;
892
-  if (window.windowLevel!=UIWindowLevelNormal) {
893
-    for (UIWindow *wid in [UIApplication sharedApplication].windows) {
894
-      if (window.windowLevel==UIWindowLevelNormal) {
895
-        window = wid;
896
-        break;
897
-      }
898
-    }
899
-  }
900
-  return window;
901
-}
902
 #endif // !TARGET_OS_OSX
895
 #endif // !TARGET_OS_OSX
903
 
896
 
904
 /**
897
 /**
925
 
918
 
926
   WKNavigationType navigationType = navigationAction.navigationType;
919
   WKNavigationType navigationType = navigationAction.navigationType;
927
   NSURLRequest *request = navigationAction.request;
920
   NSURLRequest *request = navigationAction.request;
921
+  BOOL isTopFrame = [request.URL isEqual:request.mainDocumentURL];
928
 
922
 
929
   if (_onShouldStartLoadWithRequest) {
923
   if (_onShouldStartLoadWithRequest) {
930
     NSMutableDictionary<NSString *, id> *event = [self baseEvent];
924
     NSMutableDictionary<NSString *, id> *event = [self baseEvent];
931
     [event addEntriesFromDictionary: @{
925
     [event addEntriesFromDictionary: @{
932
       @"url": (request.URL).absoluteString,
926
       @"url": (request.URL).absoluteString,
933
       @"mainDocumentURL": (request.mainDocumentURL).absoluteString,
927
       @"mainDocumentURL": (request.mainDocumentURL).absoluteString,
934
-      @"navigationType": navigationTypes[@(navigationType)]
928
+      @"navigationType": navigationTypes[@(navigationType)],
929
+      @"isTopFrame": @(isTopFrame)
935
     }];
930
     }];
936
     if (![self.delegate webView:self
931
     if (![self.delegate webView:self
937
       shouldStartLoadForRequest:event
932
       shouldStartLoadForRequest:event
943
 
938
 
944
   if (_onLoadingStart) {
939
   if (_onLoadingStart) {
945
     // We have this check to filter out iframe requests and whatnot
940
     // We have this check to filter out iframe requests and whatnot
946
-    BOOL isTopFrame = [request.URL isEqual:request.mainDocumentURL];
947
     if (isTopFrame) {
941
     if (isTopFrame) {
948
       NSMutableDictionary<NSString *, id> *event = [self baseEvent];
942
       NSMutableDictionary<NSString *, id> *event = [self baseEvent];
949
       [event addEntriesFromDictionary: @{
943
       [event addEntriesFromDictionary: @{
1143
   }
1137
   }
1144
 }
1138
 }
1145
 
1139
 
1140
+- (void)addPullToRefreshControl
1141
+{
1142
+    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
1143
+    _refreshControl = refreshControl;
1144
+    [_webView.scrollView addSubview: refreshControl];
1145
+    [refreshControl addTarget:self action:@selector(pullToRefresh:) forControlEvents: UIControlEventValueChanged];
1146
+}
1147
+
1148
+- (void)pullToRefresh:(UIRefreshControl *)refreshControl
1149
+{
1150
+    [self reload];
1151
+    [refreshControl endRefreshing];
1152
+}
1153
+
1154
+#if !TARGET_OS_OSX
1155
+- (void)setPullToRefreshEnabled:(BOOL)pullToRefreshEnabled
1156
+{
1157
+    _pullToRefreshEnabled = pullToRefreshEnabled;
1158
+    
1159
+    if (pullToRefreshEnabled) {
1160
+        [self addPullToRefreshControl];
1161
+    } else {
1162
+        [_refreshControl removeFromSuperview];
1163
+    }
1164
+
1165
+    [self setBounces:_bounces];
1166
+}
1167
+#endif // !TARGET_OS_OSX
1168
+
1146
 - (void)stopLoading
1169
 - (void)stopLoading
1147
 {
1170
 {
1148
   [_webView stopLoading];
1171
   [_webView stopLoading];
1152
 - (void)setBounces:(BOOL)bounces
1175
 - (void)setBounces:(BOOL)bounces
1153
 {
1176
 {
1154
   _bounces = bounces;
1177
   _bounces = bounces;
1155
-  _webView.scrollView.bounces = bounces;
1178
+    //For UIRefreshControl to work correctly, the bounces should always be true
1179
+  _webView.scrollView.bounces = _pullToRefreshEnabled || bounces;
1156
 }
1180
 }
1157
 #endif // !TARGET_OS_OSX
1181
 #endif // !TARGET_OS_OSX
1158
 
1182
 
1159
-
1160
 - (void)setInjectedJavaScript:(NSString *)source {
1183
 - (void)setInjectedJavaScript:(NSString *)source {
1161
   _injectedJavaScript = source;
1184
   _injectedJavaScript = source;
1162
 
1185
 
1361
 }
1384
 }
1362
 
1385
 
1363
 @end
1386
 @end
1364
-

+ 20
- 0
apple/RNCWebViewManager.m Näytä tiedosto

14
 @interface RNCWebViewManager () <RNCWebViewDelegate>
14
 @interface RNCWebViewManager () <RNCWebViewDelegate>
15
 @end
15
 @end
16
 
16
 
17
+@implementation RCTConvert (WKWebView)
18
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
19
+RCT_ENUM_CONVERTER(WKContentMode, (@{
20
+    @"recommended": @(WKContentModeRecommended),
21
+    @"mobile": @(WKContentModeMobile),
22
+    @"desktop": @(WKContentModeDesktop),
23
+}), WKContentModeRecommended, integerValue)
24
+#endif
25
+@end
26
+
17
 @implementation RNCWebViewManager
27
 @implementation RNCWebViewManager
18
 {
28
 {
19
   NSConditionLock *_shouldStartLoadLock;
29
   NSConditionLock *_shouldStartLoadLock;
47
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptForMainFrameOnly, BOOL)
57
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptForMainFrameOnly, BOOL)
48
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoadedForMainFrameOnly, BOOL)
58
 RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoadedForMainFrameOnly, BOOL)
49
 RCT_EXPORT_VIEW_PROPERTY(javaScriptEnabled, BOOL)
59
 RCT_EXPORT_VIEW_PROPERTY(javaScriptEnabled, BOOL)
60
+RCT_EXPORT_VIEW_PROPERTY(javaScriptCanOpenWindowsAutomatically, BOOL)
50
 RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL)
61
 RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL)
51
 RCT_EXPORT_VIEW_PROPERTY(allowsInlineMediaPlayback, BOOL)
62
 RCT_EXPORT_VIEW_PROPERTY(allowsInlineMediaPlayback, BOOL)
52
 RCT_EXPORT_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, BOOL)
63
 RCT_EXPORT_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, BOOL)
55
 #endif
66
 #endif
56
 RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)
67
 RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)
57
 RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)
68
 RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)
69
+RCT_EXPORT_VIEW_PROPERTY(autoManageStatusBarEnabled, BOOL)
58
 RCT_EXPORT_VIEW_PROPERTY(hideKeyboardAccessoryView, BOOL)
70
 RCT_EXPORT_VIEW_PROPERTY(hideKeyboardAccessoryView, BOOL)
59
 RCT_EXPORT_VIEW_PROPERTY(allowsBackForwardNavigationGestures, BOOL)
71
 RCT_EXPORT_VIEW_PROPERTY(allowsBackForwardNavigationGestures, BOOL)
60
 RCT_EXPORT_VIEW_PROPERTY(incognito, BOOL)
72
 RCT_EXPORT_VIEW_PROPERTY(incognito, BOOL)
69
 RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
81
 RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
70
 #endif
82
 #endif
71
 
83
 
84
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
85
+RCT_EXPORT_VIEW_PROPERTY(contentMode, WKContentMode)
86
+#endif
87
+
72
 /**
88
 /**
73
  * Expose methods to enable messaging the webview.
89
  * Expose methods to enable messaging the webview.
74
  */
90
  */
88
   }];
104
   }];
89
 }
105
 }
90
 
106
 
107
+RCT_CUSTOM_VIEW_PROPERTY(pullToRefreshEnabled, BOOL, RNCWebView) {
108
+    view.pullToRefreshEnabled = json == nil ? false : [RCTConvert BOOL: json];
109
+}
110
+
91
 RCT_CUSTOM_VIEW_PROPERTY(bounces, BOOL, RNCWebView) {
111
 RCT_CUSTOM_VIEW_PROPERTY(bounces, BOOL, RNCWebView) {
92
   view.bounces = json == nil ? true : [RCTConvert BOOL: json];
112
   view.bounces = json == nil ? true : [RCTConvert BOOL: json];
93
 }
113
 }

+ 1
- 1
docs/Custom-Android.md Näytä tiedosto

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
 

+ 3
- 1
docs/Debugging.md Näytä tiedosto

15
 3. Safari -> Develop -> [device name] -> [app name] -> [url - title]
15
 3. Safari -> Develop -> [device name] -> [app name] -> [url - title]
16
 4. You can now debug the WebView contents just as you would on the web
16
 4. You can now debug the WebView contents just as you would on the web
17
 
17
 
18
-##### Note:
18
+##### Notes:
19
 
19
 
20
 When debugging on device you must enable Web Inspector in your device settings:
20
 When debugging on device you must enable Web Inspector in your device settings:
21
 
21
 
22
 Settings -> Safari -> Advanced -> Web Inspector
22
 Settings -> Safari -> Advanced -> Web Inspector
23
 
23
 
24
+Also, if you don't see your device in the Develop menu, and you started Safari before you started your simulator, try restarting Safari.
25
+
24
 ### Android & Chrome
26
 ### Android & Chrome
25
 
27
 
26
 It's possible to debug WebView contents in the Android emulator or on a device using Chrome DevTools.
28
 It's possible to debug WebView contents in the Android emulator or on a device using Chrome DevTools.

+ 26
- 16
docs/Guide.md Näytä tiedosto

55
 
55
 
56
 ### Loading local HTML files
56
 ### Loading local HTML files
57
 
57
 
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
+
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 and Windows, you can just import the html file like any other asset as shown below.
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
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;
235
 trigger calls to `onFileDownload`.
241
 trigger calls to `onFileDownload`.
236
 
242
 
237
 Example:
243
 Example:
244
+
238
 ```javascript
245
 ```javascript
239
-  onFileDownload = ({ nativeEvent }) => {
240
-    const { downloadUrl } = nativeEvent;
241
-    // --> Your download code goes here <--
242
-  }
246
+onFileDownload = ({ nativeEvent }) => {
247
+  const { downloadUrl } = nativeEvent;
248
+  // --> Your download code goes here <--
249
+};
243
 ```
250
 ```
244
 
251
 
245
 To be able to save images to the gallery you need to specify this permission in your `ios/[project]/Info.plist` file:
252
 To be able to save images to the gallery you need to specify this permission in your `ios/[project]/Info.plist` file:
252
 ##### Android
259
 ##### Android
253
 
260
 
254
 On Android, integration with the DownloadManager is built-in.
261
 On Android, integration with the DownloadManager is built-in.
255
-All you have to do to support downloads is add these permissions in AndroidManifest.xml:
262
+Add this permisison in AndroidManifest.xml (only required if your app supports Android versions lower than 10):
256
 
263
 
257
 ```xml
264
 ```xml
258
 <manifest ...>
265
 <manifest ...>
259
   ......
266
   ......
260
 
267
 
261
-  <!-- this is required to save files on Android  -->
268
+  <!-- this is required to save files on Android versions lower than 10 -->
262
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
269
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
263
 
270
 
264
   ......
271
   ......
298
             uri:
305
             uri:
299
               'https://github.com/react-native-community/react-native-webview',
306
               'https://github.com/react-native-community/react-native-webview',
300
           }}
307
           }}
308
+          onMessage={(event) => {}}
301
           injectedJavaScript={runFirst}
309
           injectedJavaScript={runFirst}
302
         />
310
         />
303
       </View>
311
       </View>
306
 }
314
 }
307
 ```
315
 ```
308
 
316
 
309
-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.
317
+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. An `onMessage` event is required as well to inject the JavaScript code into the WebView.
310
 
318
 
311
-By setting `injectedJavaScriptForMainFrameOnly: false`, the JavaScript injection will occur on all frames (not just the top frame) if supported for the given platform.
319
+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).
312
 
320
 
313
 <img alt="screenshot of Github repo" width="200" src="https://user-images.githubusercontent.com/1479215/53609254-e5dc9c00-3b7a-11e9-9118-bc4e520ce6ca.png" />
321
 <img alt="screenshot of Github repo" width="200" src="https://user-images.githubusercontent.com/1479215/53609254-e5dc9c00-3b7a-11e9-9118-bc4e520ce6ca.png" />
314
 
322
 
349
 
357
 
350
 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.
358
 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.
351
 
359
 
352
-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.
360
+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.
353
 
361
 
354
 > 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.
362
 > 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.
355
 > On Android, `injectedJavaScript` runs a method on the Android WebView called `evaluateJavascriptWithFallback`
363
 > On Android, `injectedJavaScript` runs a method on the Android WebView called `evaluateJavascriptWithFallback`
364
+> 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.
356
 
365
 
357
 #### The `injectJavaScript` method
366
 #### The `injectJavaScript` method
358
 
367
 
377
     return (
386
     return (
378
       <View style={{ flex: 1 }}>
387
       <View style={{ flex: 1 }}>
379
         <WebView
388
         <WebView
380
-          ref={r => (this.webref = r)}
389
+          ref={(r) => (this.webref = r)}
381
           source={{
390
           source={{
382
             uri:
391
             uri:
383
               'https://github.com/react-native-community/react-native-webview',
392
               'https://github.com/react-native-community/react-native-webview',
430
       <View style={{ flex: 1 }}>
439
       <View style={{ flex: 1 }}>
431
         <WebView
440
         <WebView
432
           source={{ html }}
441
           source={{ html }}
433
-          onMessage={event => {
442
+          onMessage={(event) => {
434
             alert(event.nativeEvent.data);
443
             alert(event.nativeEvent.data);
435
           }}
444
           }}
436
         />
445
         />
466
 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)):
475
 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)):
467
 
476
 
468
 ```jsx
477
 ```jsx
469
-const CustomHeaderWebView = props => {
478
+const CustomHeaderWebView = (props) => {
470
   const { uri, onLoadStart, ...restProps } = props;
479
   const { uri, onLoadStart, ...restProps } = props;
471
   const [currentURI, setURI] = useState(props.source.uri);
480
   const [currentURI, setURI] = useState(props.source.uri);
472
   const newSource = { ...props.source, uri: currentURI };
481
   const newSource = { ...props.source, uri: currentURI };
475
     <WebView
484
     <WebView
476
       {...restProps}
485
       {...restProps}
477
       source={newSource}
486
       source={newSource}
478
-      onShouldStartLoadWithRequest={request => {
487
+      onShouldStartLoadWithRequest={(request) => {
479
         // If we're loading the current URI, allow it to load
488
         // If we're loading the current URI, allow it to load
480
         if (request.url === currentURI) return true;
489
         if (request.url === currentURI) return true;
481
         // We're loading a new URL -- change state first
490
         // We're loading a new URL -- change state first
500
 
509
 
501
 You can set cookies on the React Native side using the [@react-native-community/cookies](https://github.com/react-native-community/cookies) package.
510
 You can set cookies on the React Native side using the [@react-native-community/cookies](https://github.com/react-native-community/cookies) package.
502
 
511
 
503
-When you do, you'll likely want to enable the [sharedCookiesEnabled](Reference#sharedCookiesEnabled) prop as well.
512
+When you do, you'll likely want to enable the [sharedCookiesEnabled](Reference.md#sharedCookiesEnabled) prop as well.
504
 
513
 
505
 ```jsx
514
 ```jsx
506
 const App = () => {
515
 const App = () => {
534
 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
 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).
535
 
544
 
536
 ### Hardware Silence Switch
545
 ### Hardware Silence Switch
546
+
537
 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
 There are some inconsistencies in how the hardware silence switch is handled between embedded `audio` and `video` elements and between iOS and Android platforms.
538
 
548
 
539
 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
 Audio on `iOS` will be muted when the hardware silence switch is in the on position, unless the `ignoreSilentHardwareSwitch` parameter is set to true.

+ 5
- 1
docs/README.portuguese.md Näytä tiedosto

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
 

+ 255
- 137
docs/Reference.md
File diff suppressed because it is too large
Näytä tiedosto


+ 7
- 0
example/android/app/src/main/java/com/example/MainApplication.java Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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

+ 28
- 27
example/examples/Injection.tsx Näytä tiedosto

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>

+ 3
- 3
example/ios/Podfile Näytä tiedosto

31
   pod 'React-jsi', :path => '../../node_modules/react-native/ReactCommon/jsi'
31
   pod 'React-jsi', :path => '../../node_modules/react-native/ReactCommon/jsi'
32
   pod 'React-jsiexecutor', :path => '../../node_modules/react-native/ReactCommon/jsiexecutor'
32
   pod 'React-jsiexecutor', :path => '../../node_modules/react-native/ReactCommon/jsiexecutor'
33
   pod 'React-jsinspector', :path => '../../node_modules/react-native/ReactCommon/jsinspector'
33
   pod 'React-jsinspector', :path => '../../node_modules/react-native/ReactCommon/jsinspector'
34
-  pod 'ReactCommon/jscallinvoker', :path => "../../node_modules/react-native/ReactCommon"
34
+  pod 'ReactCommon/callinvoker', :path => "../../node_modules/react-native/ReactCommon"
35
   pod 'ReactCommon/turbomodule/core', :path => "../../node_modules/react-native/ReactCommon"
35
   pod 'ReactCommon/turbomodule/core', :path => "../../node_modules/react-native/ReactCommon"
36
-  pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga'
36
+  pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
37
 
37
 
38
   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'
39
   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'
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 Näytä tiedosto

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 (9.3.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: 60d883f994e96a560756c14592552e02a06d604d
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: c2e136f84288494fa269d79892a8a1cf7acd7c71
366
+PODFILE CHECKSUM: 767ae042fafc1aba97b301c58c340ff6f992aa27
343
 
367
 
344
-COCOAPODS: 1.8.4
368
+COCOAPODS: 1.9.1

+ 11
- 7
example/ios/example.xcodeproj/project.pbxproj Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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
- 42
example/macos/Podfile Näytä tiedosto

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
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

+ 8
- 8
example/macos/example-iOS/AppDelegate.h Näytä tiedosto

1
-#import <React/RCTBridgeDelegate.h>
2
-#import <UIKit/UIKit.h>
3
-
4
-@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
5
-
6
-@property (nonatomic, strong) UIWindow *window;
7
-
8
-@end
1
+#import <React/RCTBridgeDelegate.h>
2
+#import <UIKit/UIKit.h>
3
+
4
+@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
5
+
6
+@property (nonatomic, strong) UIWindow *window;
7
+
8
+@end

+ 35
- 35
example/macos/example-iOS/AppDelegate.m Näytä tiedosto

1
-#import "AppDelegate.h"
2
-
3
-#import <React/RCTBridge.h>
4
-#import <React/RCTBundleURLProvider.h>
5
-#import <React/RCTRootView.h>
6
-
7
-@implementation AppDelegate
8
-
9
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
10
-{
11
-  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
12
-  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
13
-                                                   moduleName:@"example"
14
-                                            initialProperties:nil];
15
-
16
-  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
17
-
18
-  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
19
-  UIViewController *rootViewController = [UIViewController new];
20
-  rootViewController.view = rootView;
21
-  self.window.rootViewController = rootViewController;
22
-  [self.window makeKeyAndVisible];
23
-  return YES;
24
-}
25
-
26
-- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
27
-{
28
-#if DEBUG
29
-  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:nil];
30
-#else
31
-  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
32
-#endif
33
-}
34
-
35
-@end
1
+#import "AppDelegate.h"
2
+
3
+#import <React/RCTBridge.h>
4
+#import <React/RCTBundleURLProvider.h>
5
+#import <React/RCTRootView.h>
6
+
7
+@implementation AppDelegate
8
+
9
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
10
+{
11
+  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
12
+  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
13
+                                                   moduleName:@"example"
14
+                                            initialProperties:nil];
15
+
16
+  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
17
+
18
+  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
19
+  UIViewController *rootViewController = [UIViewController new];
20
+  rootViewController.view = rootView;
21
+  self.window.rootViewController = rootViewController;
22
+  [self.window makeKeyAndVisible];
23
+  return YES;
24
+}
25
+
26
+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
27
+{
28
+#if DEBUG
29
+  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:nil];
30
+#else
31
+  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
32
+#endif
33
+}
34
+
35
+@end

+ 42
- 42
example/macos/example-iOS/Base.lproj/LaunchScreen.xib Näytä tiedosto

1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
3
-    <dependencies>
4
-        <deployment identifier="iOS"/>
5
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
6
-        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
7
-    </dependencies>
8
-    <objects>
9
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
10
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
11
-        <view contentMode="scaleToFill" id="iN0-l3-epB">
12
-            <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
13
-            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
14
-            <subviews>
15
-                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
16
-                    <rect key="frame" x="20" y="439" width="441" height="21"/>
17
-                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
18
-                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
19
-                    <nil key="highlightedColor"/>
20
-                </label>
21
-                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="example" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
22
-                    <rect key="frame" x="20" y="140" width="441" height="43"/>
23
-                    <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
24
-                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
25
-                    <nil key="highlightedColor"/>
26
-                </label>
27
-            </subviews>
28
-            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
29
-            <constraints>
30
-                <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
31
-                <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
32
-                <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
33
-                <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
34
-                <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
35
-                <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
36
-            </constraints>
37
-            <nil key="simulatedStatusBarMetrics"/>
38
-            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
39
-            <point key="canvasLocation" x="548" y="455"/>
40
-        </view>
41
-    </objects>
42
-</document>
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
3
+    <dependencies>
4
+        <deployment identifier="iOS"/>
5
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
6
+        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
7
+    </dependencies>
8
+    <objects>
9
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
10
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
11
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
12
+            <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
13
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
14
+            <subviews>
15
+                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
16
+                    <rect key="frame" x="20" y="439" width="441" height="21"/>
17
+                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
18
+                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
19
+                    <nil key="highlightedColor"/>
20
+                </label>
21
+                <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="example" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
22
+                    <rect key="frame" x="20" y="140" width="441" height="43"/>
23
+                    <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
24
+                    <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
25
+                    <nil key="highlightedColor"/>
26
+                </label>
27
+            </subviews>
28
+            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
29
+            <constraints>
30
+                <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
31
+                <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
32
+                <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
33
+                <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
34
+                <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
35
+                <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
36
+            </constraints>
37
+            <nil key="simulatedStatusBarMetrics"/>
38
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
39
+            <point key="canvasLocation" x="548" y="455"/>
40
+        </view>
41
+    </objects>
42
+</document>

+ 37
- 37
example/macos/example-iOS/Images.xcassets/AppIcon.appiconset/Contents.json Näytä tiedosto

1
-{
2
-  "images" : [
3
-    {
4
-      "idiom" : "iphone",
5
-      "size" : "29x29",
6
-      "scale" : "2x"
7
-    },
8
-    {
9
-      "idiom" : "iphone",
10
-      "size" : "29x29",
11
-      "scale" : "3x"
12
-    },
13
-    {
14
-      "idiom" : "iphone",
15
-      "size" : "40x40",
16
-      "scale" : "2x"
17
-    },
18
-    {
19
-      "idiom" : "iphone",
20
-      "size" : "40x40",
21
-      "scale" : "3x"
22
-    },
23
-    {
24
-      "idiom" : "iphone",
25
-      "size" : "60x60",
26
-      "scale" : "2x"
27
-    },
28
-    {
29
-      "idiom" : "iphone",
30
-      "size" : "60x60",
31
-      "scale" : "3x"
32
-    }
33
-  ],
34
-  "info" : {
35
-    "version" : 1,
36
-    "author" : "xcode"
37
-  }
1
+{
2
+  "images" : [
3
+    {
4
+      "idiom" : "iphone",
5
+      "size" : "29x29",
6
+      "scale" : "2x"
7
+    },
8
+    {
9
+      "idiom" : "iphone",
10
+      "size" : "29x29",
11
+      "scale" : "3x"
12
+    },
13
+    {
14
+      "idiom" : "iphone",
15
+      "size" : "40x40",
16
+      "scale" : "2x"
17
+    },
18
+    {
19
+      "idiom" : "iphone",
20
+      "size" : "40x40",
21
+      "scale" : "3x"
22
+    },
23
+    {
24
+      "idiom" : "iphone",
25
+      "size" : "60x60",
26
+      "scale" : "2x"
27
+    },
28
+    {
29
+      "idiom" : "iphone",
30
+      "size" : "60x60",
31
+      "scale" : "3x"
32
+    }
33
+  ],
34
+  "info" : {
35
+    "version" : 1,
36
+    "author" : "xcode"
37
+  }
38
 }
38
 }

+ 6
- 6
example/macos/example-iOS/Images.xcassets/Contents.json Näytä tiedosto

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

+ 57
- 57
example/macos/example-iOS/Info.plist Näytä tiedosto

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>CFBundleDevelopmentRegion</key>
6
-	<string>en</string>
7
-	<key>CFBundleDisplayName</key>
8
-	<string>$(PRODUCT_NAME)</string>
9
-	<key>CFBundleExecutable</key>
10
-	<string>$(EXECUTABLE_NAME)</string>
11
-	<key>CFBundleIdentifier</key>
12
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
-	<key>CFBundleInfoDictionaryVersion</key>
14
-	<string>6.0</string>
15
-	<key>CFBundleName</key>
16
-	<string>$(PRODUCT_NAME)</string>
17
-	<key>CFBundlePackageType</key>
18
-	<string>APPL</string>
19
-	<key>CFBundleShortVersionString</key>
20
-	<string>1.0</string>
21
-	<key>CFBundleSignature</key>
22
-	<string>????</string>
23
-	<key>CFBundleVersion</key>
24
-	<string>1</string>
25
-	<key>LSRequiresIPhoneOS</key>
26
-	<true/>
27
-	<key>NSAppTransportSecurity</key>
28
-	<dict>
29
-		<key>NSAllowsArbitraryLoads</key>
30
-		<true/>
31
-		<key>NSExceptionDomains</key>
32
-		<dict>
33
-			<key>localhost</key>
34
-			<dict>
35
-				<key>NSExceptionAllowsInsecureHTTPLoads</key>
36
-				<true/>
37
-			</dict>
38
-		</dict>
39
-	</dict>
40
-	<key>NSLocationWhenInUseUsageDescription</key>
41
-	<string></string>
42
-	<key>UILaunchStoryboardName</key>
43
-	<string>LaunchScreen</string>
44
-	<key>UIRequiredDeviceCapabilities</key>
45
-	<array>
46
-		<string>armv7</string>
47
-	</array>
48
-	<key>UISupportedInterfaceOrientations</key>
49
-	<array>
50
-		<string>UIInterfaceOrientationPortrait</string>
51
-		<string>UIInterfaceOrientationLandscapeLeft</string>
52
-		<string>UIInterfaceOrientationLandscapeRight</string>
53
-	</array>
54
-	<key>UIViewControllerBasedStatusBarAppearance</key>
55
-	<false/>
56
-</dict>
57
-</plist>
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>CFBundleDevelopmentRegion</key>
6
+	<string>en</string>
7
+	<key>CFBundleDisplayName</key>
8
+	<string>$(PRODUCT_NAME)</string>
9
+	<key>CFBundleExecutable</key>
10
+	<string>$(EXECUTABLE_NAME)</string>
11
+	<key>CFBundleIdentifier</key>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+	<key>CFBundleInfoDictionaryVersion</key>
14
+	<string>6.0</string>
15
+	<key>CFBundleName</key>
16
+	<string>$(PRODUCT_NAME)</string>
17
+	<key>CFBundlePackageType</key>
18
+	<string>APPL</string>
19
+	<key>CFBundleShortVersionString</key>
20
+	<string>1.0</string>
21
+	<key>CFBundleSignature</key>
22
+	<string>????</string>
23
+	<key>CFBundleVersion</key>
24
+	<string>1</string>
25
+	<key>LSRequiresIPhoneOS</key>
26
+	<true/>
27
+	<key>NSAppTransportSecurity</key>
28
+	<dict>
29
+		<key>NSAllowsArbitraryLoads</key>
30
+		<true/>
31
+		<key>NSExceptionDomains</key>
32
+		<dict>
33
+			<key>localhost</key>
34
+			<dict>
35
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
36
+				<true/>
37
+			</dict>
38
+		</dict>
39
+	</dict>
40
+	<key>NSLocationWhenInUseUsageDescription</key>
41
+	<string></string>
42
+	<key>UILaunchStoryboardName</key>
43
+	<string>LaunchScreen</string>
44
+	<key>UIRequiredDeviceCapabilities</key>
45
+	<array>
46
+		<string>armv7</string>
47
+	</array>
48
+	<key>UISupportedInterfaceOrientations</key>
49
+	<array>
50
+		<string>UIInterfaceOrientationPortrait</string>
51
+		<string>UIInterfaceOrientationLandscapeLeft</string>
52
+		<string>UIInterfaceOrientationLandscapeRight</string>
53
+	</array>
54
+	<key>UIViewControllerBasedStatusBarAppearance</key>
55
+	<false/>
56
+</dict>
57
+</plist>

+ 9
- 9
example/macos/example-iOS/main.m Näytä tiedosto

1
-#import <UIKit/UIKit.h>
2
-
3
-#import "AppDelegate.h"
4
-
5
-int main(int argc, char * argv[]) {
6
-  @autoreleasepool {
7
-    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8
-  }
9
-}
1
+#import <UIKit/UIKit.h>
2
+
3
+#import "AppDelegate.h"
4
+
5
+int main(int argc, char * argv[]) {
6
+  @autoreleasepool {
7
+    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8
+  }
9
+}

+ 9
- 9
example/macos/example-macOS/AppDelegate.h Näytä tiedosto

1
-#import <Cocoa/Cocoa.h>
2
-
3
-@class RCTBridge;
4
-
5
-@interface AppDelegate : NSObject <NSApplicationDelegate>
6
-
7
-@property (nonatomic, readonly) RCTBridge *bridge;
8
-
9
-@end
1
+#import <Cocoa/Cocoa.h>
2
+
3
+@class RCTBridge;
4
+
5
+@interface AppDelegate : NSObject <NSApplicationDelegate>
6
+
7
+@property (nonatomic, readonly) RCTBridge *bridge;
8
+
9
+@end

+ 32
- 32
example/macos/example-macOS/AppDelegate.m Näytä tiedosto

1
-#import "AppDelegate.h"
2
-
3
-#import <React/RCTBridge.h>
4
-#import <React/RCTBundleURLProvider.h>
5
-
6
-@interface AppDelegate () <RCTBridgeDelegate>
7
-
8
-@end
9
-
10
-@implementation AppDelegate
11
-
12
-- (void)awakeFromNib {
13
-  [super awakeFromNib];
14
-
15
-  _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
16
-}
17
-
18
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
19
-  // Insert code here to initialize your application
20
-}
21
-
22
-- (void)applicationWillTerminate:(NSNotification *)aNotification {
23
-  // Insert code here to tear down your application
24
-}
25
-
26
-#pragma mark - RCTBridgeDelegate Methods
27
-
28
-- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge {
29
-  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:@"main"]; // .jsbundle;
30
-}
31
-
32
-@end
1
+#import "AppDelegate.h"
2
+
3
+#import <React/RCTBridge.h>
4
+#import <React/RCTBundleURLProvider.h>
5
+
6
+@interface AppDelegate () <RCTBridgeDelegate>
7
+
8
+@end
9
+
10
+@implementation AppDelegate
11
+
12
+- (void)awakeFromNib {
13
+  [super awakeFromNib];
14
+
15
+  _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
16
+}
17
+
18
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
19
+  // Insert code here to initialize your application
20
+}
21
+
22
+- (void)applicationWillTerminate:(NSNotification *)aNotification {
23
+  // Insert code here to tear down your application
24
+}
25
+
26
+#pragma mark - RCTBridgeDelegate Methods
27
+
28
+- (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge {
29
+  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"example/index" fallbackResource:@"main"]; // .jsbundle;
30
+}
31
+
32
+@end

+ 58
- 58
example/macos/example-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json Näytä tiedosto

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
-}
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
- 6
example/macos/example-macOS/Assets.xcassets/Contents.json Näytä tiedosto

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

+ 717
- 717
example/macos/example-macOS/Base.lproj/Main.storyboard
File diff suppressed because it is too large
Näytä tiedosto


+ 47
- 47
example/macos/example-macOS/Info.plist Näytä tiedosto

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>CFBundleDevelopmentRegion</key>
6
-	<string>$(DEVELOPMENT_LANGUAGE)</string>
7
-	<key>CFBundleExecutable</key>
8
-	<string>$(EXECUTABLE_NAME)</string>
9
-	<key>CFBundleIconFile</key>
10
-	<string></string>
11
-	<key>CFBundleIdentifier</key>
12
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
-	<key>CFBundleInfoDictionaryVersion</key>
14
-	<string>6.0</string>
15
-	<key>CFBundleName</key>
16
-	<string>$(PRODUCT_NAME)</string>
17
-	<key>CFBundlePackageType</key>
18
-	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19
-	<key>CFBundleShortVersionString</key>
20
-	<string>1.0</string>
21
-	<key>CFBundleVersion</key>
22
-	<string>1</string>
23
-	<key>LSMinimumSystemVersion</key>
24
-	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
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>NSMainStoryboardFile</key>
39
-	<string>Main</string>
40
-	<key>NSPrincipalClass</key>
41
-	<string>NSApplication</string>
42
-	<key>NSSupportsAutomaticTermination</key>
43
-	<true/>
44
-	<key>NSSupportsSuddenTermination</key>
45
-	<true/>
46
-</dict>
47
-</plist>
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>CFBundleDevelopmentRegion</key>
6
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
7
+	<key>CFBundleExecutable</key>
8
+	<string>$(EXECUTABLE_NAME)</string>
9
+	<key>CFBundleIconFile</key>
10
+	<string></string>
11
+	<key>CFBundleIdentifier</key>
12
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+	<key>CFBundleInfoDictionaryVersion</key>
14
+	<string>6.0</string>
15
+	<key>CFBundleName</key>
16
+	<string>$(PRODUCT_NAME)</string>
17
+	<key>CFBundlePackageType</key>
18
+	<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19
+	<key>CFBundleShortVersionString</key>
20
+	<string>1.0</string>
21
+	<key>CFBundleVersion</key>
22
+	<string>1</string>
23
+	<key>LSMinimumSystemVersion</key>
24
+	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
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>NSMainStoryboardFile</key>
39
+	<string>Main</string>
40
+	<key>NSPrincipalClass</key>
41
+	<string>NSApplication</string>
42
+	<key>NSSupportsAutomaticTermination</key>
43
+	<true/>
44
+	<key>NSSupportsSuddenTermination</key>
45
+	<true/>
46
+</dict>
47
+</plist>

+ 5
- 5
example/macos/example-macOS/ViewController.h Näytä tiedosto

1
-#import <Cocoa/Cocoa.h>
2
-
3
-@interface ViewController : NSViewController
4
-
5
-@end
1
+#import <Cocoa/Cocoa.h>
2
+
3
+@interface ViewController : NSViewController
4
+
5
+@end

+ 22
- 22
example/macos/example-macOS/ViewController.m Näytä tiedosto

1
-#import "ViewController.h"
2
-#import "AppDelegate.h"
3
-
4
-#import <React/RCTRootView.h>
5
-
6
-@implementation ViewController
7
-
8
-- (void)viewDidLoad {
9
-  [super viewDidLoad];
10
-
11
-  RCTBridge *bridge = [((AppDelegate *)[NSApp delegate])bridge];
12
-  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"example" initialProperties:nil];
13
-
14
-  NSView *view = [self view];
15
-
16
-  [view addSubview:rootView];
17
-  [rootView setBackgroundColor:[NSColor windowBackgroundColor]];
18
-  [rootView setFrame:[view bounds]];
19
-  [rootView setAutoresizingMask:(NSViewMinXMargin | NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable)];
20
-}
21
-
22
-@end
1
+#import "ViewController.h"
2
+#import "AppDelegate.h"
3
+
4
+#import <React/RCTRootView.h>
5
+
6
+@implementation ViewController
7
+
8
+- (void)viewDidLoad {
9
+  [super viewDidLoad];
10
+
11
+  RCTBridge *bridge = [((AppDelegate *)[NSApp delegate])bridge];
12
+  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"example" initialProperties:nil];
13
+
14
+  NSView *view = [self view];
15
+
16
+  [view addSubview:rootView];
17
+  [rootView setBackgroundColor:[NSColor windowBackgroundColor]];
18
+  [rootView setFrame:[view bounds]];
19
+  [rootView setAutoresizingMask:(NSViewMinXMargin | NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable)];
20
+}
21
+
22
+@end

+ 12
- 12
example/macos/example-macOS/example.entitlements Näytä tiedosto

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>
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>

+ 5
- 5
example/macos/example-macOS/main.m Näytä tiedosto

1
-#import <Cocoa/Cocoa.h>
2
-
3
-int main(int argc, const char *argv[]) {
4
-  return NSApplicationMain(argc, argv);
5
-}
1
+#import <Cocoa/Cocoa.h>
2
+
3
+int main(int argc, const char *argv[]) {
4
+  return NSApplicationMain(argc, argv);
5
+}

+ 78
- 78
example/macos/example.xcodeproj/xcshareddata/xcschemes/example-iOS.xcscheme Näytä tiedosto

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<Scheme
3
-   LastUpgradeVersion = "1140"
4
-   version = "1.3">
5
-   <BuildAction
6
-      parallelizeBuildables = "YES"
7
-      buildImplicitDependencies = "YES">
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 = "13B07F861A680F5B00A75B9A"
18
-               BuildableName = "example.app"
19
-               BlueprintName = "example-iOS"
20
-               ReferencedContainer = "container:example.xcodeproj">
21
-            </BuildableReference>
22
-         </BuildActionEntry>
23
-      </BuildActionEntries>
24
-   </BuildAction>
25
-   <TestAction
26
-      buildConfiguration = "Debug"
27
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
-      shouldUseLaunchSchemeArgsEnv = "YES">
30
-      <Testables>
31
-      </Testables>
32
-   </TestAction>
33
-   <LaunchAction
34
-      buildConfiguration = "Debug"
35
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
-      launchStyle = "0"
38
-      useCustomWorkingDirectory = "NO"
39
-      ignoresPersistentStateOnLaunch = "NO"
40
-      debugDocumentVersioning = "YES"
41
-      debugServiceExtension = "internal"
42
-      allowLocationSimulation = "YES">
43
-      <BuildableProductRunnable
44
-         runnableDebuggingMode = "0">
45
-         <BuildableReference
46
-            BuildableIdentifier = "primary"
47
-            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
48
-            BuildableName = "example.app"
49
-            BlueprintName = "example-iOS"
50
-            ReferencedContainer = "container:example.xcodeproj">
51
-         </BuildableReference>
52
-      </BuildableProductRunnable>
53
-   </LaunchAction>
54
-   <ProfileAction
55
-      buildConfiguration = "Release"
56
-      shouldUseLaunchSchemeArgsEnv = "YES"
57
-      savedToolIdentifier = ""
58
-      useCustomWorkingDirectory = "NO"
59
-      debugDocumentVersioning = "YES">
60
-      <BuildableProductRunnable
61
-         runnableDebuggingMode = "0">
62
-         <BuildableReference
63
-            BuildableIdentifier = "primary"
64
-            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
65
-            BuildableName = "example.app"
66
-            BlueprintName = "example-iOS"
67
-            ReferencedContainer = "container:example.xcodeproj">
68
-         </BuildableReference>
69
-      </BuildableProductRunnable>
70
-   </ProfileAction>
71
-   <AnalyzeAction
72
-      buildConfiguration = "Debug">
73
-   </AnalyzeAction>
74
-   <ArchiveAction
75
-      buildConfiguration = "Release"
76
-      revealArchiveInOrganizer = "YES">
77
-   </ArchiveAction>
78
-</Scheme>
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "1140"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
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 = "13B07F861A680F5B00A75B9A"
18
+               BuildableName = "example.app"
19
+               BlueprintName = "example-iOS"
20
+               ReferencedContainer = "container:example.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+      </Testables>
32
+   </TestAction>
33
+   <LaunchAction
34
+      buildConfiguration = "Debug"
35
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
+      launchStyle = "0"
38
+      useCustomWorkingDirectory = "NO"
39
+      ignoresPersistentStateOnLaunch = "NO"
40
+      debugDocumentVersioning = "YES"
41
+      debugServiceExtension = "internal"
42
+      allowLocationSimulation = "YES">
43
+      <BuildableProductRunnable
44
+         runnableDebuggingMode = "0">
45
+         <BuildableReference
46
+            BuildableIdentifier = "primary"
47
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
48
+            BuildableName = "example.app"
49
+            BlueprintName = "example-iOS"
50
+            ReferencedContainer = "container:example.xcodeproj">
51
+         </BuildableReference>
52
+      </BuildableProductRunnable>
53
+   </LaunchAction>
54
+   <ProfileAction
55
+      buildConfiguration = "Release"
56
+      shouldUseLaunchSchemeArgsEnv = "YES"
57
+      savedToolIdentifier = ""
58
+      useCustomWorkingDirectory = "NO"
59
+      debugDocumentVersioning = "YES">
60
+      <BuildableProductRunnable
61
+         runnableDebuggingMode = "0">
62
+         <BuildableReference
63
+            BuildableIdentifier = "primary"
64
+            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
65
+            BuildableName = "example.app"
66
+            BlueprintName = "example-iOS"
67
+            ReferencedContainer = "container:example.xcodeproj">
68
+         </BuildableReference>
69
+      </BuildableProductRunnable>
70
+   </ProfileAction>
71
+   <AnalyzeAction
72
+      buildConfiguration = "Debug">
73
+   </AnalyzeAction>
74
+   <ArchiveAction
75
+      buildConfiguration = "Release"
76
+      revealArchiveInOrganizer = "YES">
77
+   </ArchiveAction>
78
+</Scheme>

+ 78
- 78
example/macos/example.xcodeproj/xcshareddata/xcschemes/example-macOS.xcscheme Näytä tiedosto

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<Scheme
3
-   LastUpgradeVersion = "1140"
4
-   version = "1.3">
5
-   <BuildAction
6
-      parallelizeBuildables = "YES"
7
-      buildImplicitDependencies = "YES">
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 = "514201482437B4B30078DB4F"
18
-               BuildableName = "example.app"
19
-               BlueprintName = "example-macOS"
20
-               ReferencedContainer = "container:example.xcodeproj">
21
-            </BuildableReference>
22
-         </BuildActionEntry>
23
-      </BuildActionEntries>
24
-   </BuildAction>
25
-   <TestAction
26
-      buildConfiguration = "Debug"
27
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
-      shouldUseLaunchSchemeArgsEnv = "YES">
30
-      <Testables>
31
-      </Testables>
32
-   </TestAction>
33
-   <LaunchAction
34
-      buildConfiguration = "Debug"
35
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
-      launchStyle = "0"
38
-      useCustomWorkingDirectory = "NO"
39
-      ignoresPersistentStateOnLaunch = "NO"
40
-      debugDocumentVersioning = "YES"
41
-      debugServiceExtension = "internal"
42
-      allowLocationSimulation = "YES">
43
-      <BuildableProductRunnable
44
-         runnableDebuggingMode = "0">
45
-         <BuildableReference
46
-            BuildableIdentifier = "primary"
47
-            BlueprintIdentifier = "514201482437B4B30078DB4F"
48
-            BuildableName = "example.app"
49
-            BlueprintName = "example-macOS"
50
-            ReferencedContainer = "container:example.xcodeproj">
51
-         </BuildableReference>
52
-      </BuildableProductRunnable>
53
-   </LaunchAction>
54
-   <ProfileAction
55
-      buildConfiguration = "Release"
56
-      shouldUseLaunchSchemeArgsEnv = "YES"
57
-      savedToolIdentifier = ""
58
-      useCustomWorkingDirectory = "NO"
59
-      debugDocumentVersioning = "YES">
60
-      <BuildableProductRunnable
61
-         runnableDebuggingMode = "0">
62
-         <BuildableReference
63
-            BuildableIdentifier = "primary"
64
-            BlueprintIdentifier = "514201482437B4B30078DB4F"
65
-            BuildableName = "example.app"
66
-            BlueprintName = "example-macOS"
67
-            ReferencedContainer = "container:example.xcodeproj">
68
-         </BuildableReference>
69
-      </BuildableProductRunnable>
70
-   </ProfileAction>
71
-   <AnalyzeAction
72
-      buildConfiguration = "Debug">
73
-   </AnalyzeAction>
74
-   <ArchiveAction
75
-      buildConfiguration = "Release"
76
-      revealArchiveInOrganizer = "YES">
77
-   </ArchiveAction>
78
-</Scheme>
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<Scheme
3
+   LastUpgradeVersion = "1140"
4
+   version = "1.3">
5
+   <BuildAction
6
+      parallelizeBuildables = "YES"
7
+      buildImplicitDependencies = "YES">
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 = "514201482437B4B30078DB4F"
18
+               BuildableName = "example.app"
19
+               BlueprintName = "example-macOS"
20
+               ReferencedContainer = "container:example.xcodeproj">
21
+            </BuildableReference>
22
+         </BuildActionEntry>
23
+      </BuildActionEntries>
24
+   </BuildAction>
25
+   <TestAction
26
+      buildConfiguration = "Debug"
27
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+      shouldUseLaunchSchemeArgsEnv = "YES">
30
+      <Testables>
31
+      </Testables>
32
+   </TestAction>
33
+   <LaunchAction
34
+      buildConfiguration = "Debug"
35
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37
+      launchStyle = "0"
38
+      useCustomWorkingDirectory = "NO"
39
+      ignoresPersistentStateOnLaunch = "NO"
40
+      debugDocumentVersioning = "YES"
41
+      debugServiceExtension = "internal"
42
+      allowLocationSimulation = "YES">
43
+      <BuildableProductRunnable
44
+         runnableDebuggingMode = "0">
45
+         <BuildableReference
46
+            BuildableIdentifier = "primary"
47
+            BlueprintIdentifier = "514201482437B4B30078DB4F"
48
+            BuildableName = "example.app"
49
+            BlueprintName = "example-macOS"
50
+            ReferencedContainer = "container:example.xcodeproj">
51
+         </BuildableReference>
52
+      </BuildableProductRunnable>
53
+   </LaunchAction>
54
+   <ProfileAction
55
+      buildConfiguration = "Release"
56
+      shouldUseLaunchSchemeArgsEnv = "YES"
57
+      savedToolIdentifier = ""
58
+      useCustomWorkingDirectory = "NO"
59
+      debugDocumentVersioning = "YES">
60
+      <BuildableProductRunnable
61
+         runnableDebuggingMode = "0">
62
+         <BuildableReference
63
+            BuildableIdentifier = "primary"
64
+            BlueprintIdentifier = "514201482437B4B30078DB4F"
65
+            BuildableName = "example.app"
66
+            BlueprintName = "example-macOS"
67
+            ReferencedContainer = "container:example.xcodeproj">
68
+         </BuildableReference>
69
+      </BuildableProductRunnable>
70
+   </ProfileAction>
71
+   <AnalyzeAction
72
+      buildConfiguration = "Debug">
73
+   </AnalyzeAction>
74
+   <ArchiveAction
75
+      buildConfiguration = "Release"
76
+      revealArchiveInOrganizer = "YES">
77
+   </ArchiveAction>
78
+</Scheme>

+ 1
- 0
example/windows/WebViewWindows.sln Näytä tiedosto

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 Näytä tiedosto

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
 

+ 3
- 4
example/windows/WebViewWindows/WebViewWindows.vcxproj Näytä tiedosto

161
   </ItemGroup>
161
   </ItemGroup>
162
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
162
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
163
   <PropertyGroup>
163
   <PropertyGroup>
164
-    <BundleCommand>
165
-      cd $(SolutionDir)..\..
166
-      npx react-native bundle --platform windows --entry-file example/index.js --bundle-output example/windows/WebViewWindows/Bundle/index.windows.bundle --assets-dest example/windows/WebViewWindows/Bundle --use-react-native-windows
167
-    </BundleCommand>
164
+    <BundleEntryFile>example/index.js</BundleEntryFile>
165
+    <BundlerExtraArgs>--use-react-native-windows</BundlerExtraArgs>
168
   </PropertyGroup>
166
   </PropertyGroup>
169
   <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" />
170
   <ImportGroup Label="ExtensionTargets">
169
   <ImportGroup Label="ExtensionTargets">
171
     <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')" />
172
     <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')" />

+ 24
- 24
example/windows/WebViewWindows/pch.h Näytä tiedosto

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>

+ 24
- 1
index.d.ts Näytä tiedosto

6
 
6
 
7
 export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
7
 export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
8
 
8
 
9
-declare class WebView extends Component<WebViewProps> {
9
+declare class WebView<P = {}> extends Component<WebViewProps & P> {
10
     /**
10
     /**
11
      * Go back one page in the webview's history.
11
      * Go back one page in the webview's history.
12
      */
12
      */
41
      * Focuses on WebView redered page.
41
      * Focuses on WebView redered page.
42
      */
42
      */
43
     requestFocus: () => void;
43
     requestFocus: () => void;
44
+    
45
+     /**
46
+     * Posts a message to WebView.
47
+     */
48
+    postMessage: (message: string) => void;
49
+    
50
+     /**
51
+     * (Android only)
52
+     * Removes the autocomplete popup from the currently focused form field, if present.
53
+     */
54
+    clearFormData: () => void;
55
+
56
+     /**
57
+     * (Android only)
58
+     * Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.
59
+     */
60
+    clearCache: (clear: boolean) => void;
61
+
62
+     /**
63
+     * (Android only)
64
+     * Tells this WebView to clear its internal back/forward list.
65
+     */
66
+    clearHistory: () => void;
44
 }
67
 }
45
 
68
 
46
 export {WebView};
69
 export {WebView};

+ 2
- 0
metro.config.windows.js Näytä tiedosto

35
       new RegExp(
35
       new RegExp(
36
         `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
36
         `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
37
       ),
37
       ),
38
+      // Avoid error EBUSY: resource busy or locked, open '...\vnext\msbuild.ProjectImports.zip' when building 'vnext\Microsoft.ReactNative.sln' with '/bl'
39
+      /.*\.ProjectImports\.zip/,
38
     ]),
40
     ]),
39
   },
41
   },
40
   transformer: {
42
   transformer: {

+ 90
- 91
package.json Näytä tiedosto

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.0.0",
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",
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.9",
33
-    "react-native": ">=0.60 <0.62"
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": "^3.2.0",
43
-    "@react-native-community/cli-platform-android": "^3.0.0",
44
-    "@react-native-community/cli-platform-ios": "^3.0.0",
45
-    "@semantic-release/git": "7.0.16",
46
-    "@types/invariant": "^2.2.30",
47
-    "@types/jest": "24.0.18",
48
-    "@types/react": "16.8.8",
49
-    "@types/react-native": "0.60.11",
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.54.1",
66
-    "react": "16.9.0",
67
-    "react-native": "0.61.5",
68
-    "react-native-macos": "0.60.0-microsoft.73",
69
-    "react-native-windows": "0.61.5",
70
-    "semantic-release": "15.13.24",
71
-    "typescript": "3.6.2",
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
-}
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.9.1",
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-native": ">=0.60 <0.64"
33
+  },
34
+  "dependencies": {
35
+    "escape-string-regexp": "2.0.0",
36
+    "invariant": "2.2.4"
37
+  },
38
+  "devDependencies": {
39
+    "@babel/core": "7.4.5",
40
+    "@babel/runtime": "7.4.5",
41
+    "@react-native-community/cli": "^4.8.0",
42
+    "@react-native-community/cli-platform-android": "^4.8.0",
43
+    "@react-native-community/cli-platform-ios": "^4.8.0",
44
+    "@semantic-release/git": "7.0.16",
45
+    "@types/invariant": "^2.2.30",
46
+    "@types/jest": "24.0.18",
47
+    "@types/react": "16.9.34",
48
+    "@types/react-native": "0.62.5",
49
+    "@types/selenium-webdriver": "4.0.9",
50
+    "@typescript-eslint/eslint-plugin": "2.1.0",
51
+    "@typescript-eslint/parser": "2.1.0",
52
+    "babel-eslint": "10.0.3",
53
+    "babel-jest": "24.8.0",
54
+    "babel-plugin-module-resolver": "3.1.3",
55
+    "eslint": "6.3.0",
56
+    "eslint-config-airbnb": "18.0.1",
57
+    "eslint-config-prettier": "6.2.0",
58
+    "eslint-plugin-import": "2.18.2",
59
+    "eslint-plugin-jsx-a11y": "6.2.3",
60
+    "eslint-plugin-react": "7.14.3",
61
+    "eslint-plugin-react-native": "3.7.0",
62
+    "jest": "24.9.0",
63
+    "metro": "0.56.4",
64
+    "metro-react-native-babel-preset": "^0.59.0",
65
+    "react": "16.11.0",
66
+    "react-native": "0.62.2",
67
+    "react-native-macos": "0.60.0-microsoft.73",
68
+    "react-native-windows": "^0.62.0-0",
69
+    "semantic-release": "15.13.24",
70
+    "typescript": "3.8.3",
71
+    "appium": "1.17.0",
72
+    "selenium-appium": "0.0.15",
73
+    "selenium-webdriver": "4.0.0-alpha.7"
74
+  },
75
+  "repository": {
76
+    "type": "git",
77
+    "url": "https://github.com/react-native-community/react-native-webview.git"
78
+  },
79
+  "files": [
80
+    "android",
81
+    "apple",
82
+    "ios",
83
+    "macos",
84
+    "windows",
85
+    "lib",
86
+    "index.js",
87
+    "index.d.ts",
88
+    "react-native-webview.podspec"
89
+  ]
90
+}

+ 1
- 1
react-native-webview.podspec Näytä tiedosto

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  = "apple/**/*.{h,m}"
16
   s.source_files  = "apple/**/*.{h,m}"
17
 
17
 
18
-  s.dependency 'React'
18
+  s.dependency 'React-Core'
19
 end
19
 end

+ 14
- 0
react-native.config.js Näytä tiedosto

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
 }

+ 17
- 3
src/WebView.android.tsx Näytä tiedosto

21
   defaultRenderLoading,
21
   defaultRenderLoading,
22
 } from './WebViewShared';
22
 } from './WebViewShared';
23
 import {
23
 import {
24
+  WebViewRenderProcessGoneEvent,
24
   WebViewErrorEvent,
25
   WebViewErrorEvent,
25
   WebViewHttpErrorEvent,
26
   WebViewHttpErrorEvent,
26
   WebViewMessageEvent,
27
   WebViewMessageEvent,
60
     saveFormDataDisabled: false,
61
     saveFormDataDisabled: false,
61
     cacheEnabled: true,
62
     cacheEnabled: true,
62
     androidHardwareAccelerationDisabled: false,
63
     androidHardwareAccelerationDisabled: false,
64
+    androidLayerType: 'none',
63
     originWhitelist: defaultOriginWhitelist,
65
     originWhitelist: defaultOriginWhitelist,
64
   };
66
   };
65
 
67
 
75
     lastErrorEvent: null,
77
     lastErrorEvent: null,
76
   };
78
   };
77
 
79
 
80
+  onShouldStartLoadWithRequest: ReturnType<typeof createOnShouldStartLoadWithRequest> | null = null;
78
 
81
 
79
   webViewRef = React.createRef<NativeWebViewAndroid>();
82
   webViewRef = React.createRef<NativeWebViewAndroid>();
80
 
83
 
228
     }
231
     }
229
   }
232
   }
230
 
233
 
234
+  onRenderProcessGone = (event: WebViewRenderProcessGoneEvent) => {
235
+    const { onRenderProcessGone } = this.props;
236
+    if (onRenderProcessGone) {
237
+      onRenderProcessGone(event);
238
+    }
239
+  }
240
+
231
   onLoadingFinish = (event: WebViewNavigationEvent) => {
241
   onLoadingFinish = (event: WebViewNavigationEvent) => {
232
     const { onLoad, onLoadEnd } = this.props;
242
     const { onLoad, onLoadEnd } = this.props;
233
     const { nativeEvent: { url } } = event;
243
     const { nativeEvent: { url } } = event;
271
   onShouldStartLoadWithRequestCallback = (
281
   onShouldStartLoadWithRequestCallback = (
272
     shouldStart: boolean,
282
     shouldStart: boolean,
273
     url: string,
283
     url: string,
284
+    lockIdentifier?: number,
274
   ) => {
285
   ) => {
275
-    if (shouldStart) {
286
+    if (lockIdentifier) {
287
+      NativeModules.RNCWebView.onShouldStartLoadWithRequestCallback(shouldStart, lockIdentifier);
288
+    } else if (shouldStart) {
276
       UIManager.dispatchViewManagerCommand(
289
       UIManager.dispatchViewManagerCommand(
277
         this.getWebViewHandle(),
290
         this.getWebViewHandle(),
278
         this.getCommands().loadUrl,
291
         this.getCommands().loadUrl,
329
     const NativeWebView
342
     const NativeWebView
330
       = (nativeConfig.component as typeof NativeWebViewAndroid) || RNCWebView;
343
       = (nativeConfig.component as typeof NativeWebViewAndroid) || RNCWebView;
331
 
344
 
332
-    const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
345
+    this.onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
333
       this.onShouldStartLoadWithRequestCallback,
346
       this.onShouldStartLoadWithRequestCallback,
334
       // casting cause it's in the default props
347
       // casting cause it's in the default props
335
       originWhitelist as readonly string[],
348
       originWhitelist as readonly string[],
347
         onLoadingProgress={this.onLoadingProgress}
360
         onLoadingProgress={this.onLoadingProgress}
348
         onLoadingStart={this.onLoadingStart}
361
         onLoadingStart={this.onLoadingStart}
349
         onHttpError={this.onHttpError}
362
         onHttpError={this.onHttpError}
363
+        onRenderProcessGone={this.onRenderProcessGone}
350
         onMessage={this.onMessage}
364
         onMessage={this.onMessage}
351
-        onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
365
+        onShouldStartLoadWithRequest={this.onShouldStartLoadWithRequest}
352
         ref={this.webViewRef}
366
         ref={this.webViewRef}
353
         // TODO: find a better way to type this.
367
         // TODO: find a better way to type this.
354
         source={resolveAssetSource(source as ImageSourcePropType)}
368
         source={resolveAssetSource(source as ImageSourcePropType)}

+ 18
- 3
src/WebView.tsx Näytä tiedosto

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 Näytä tiedosto

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
+}

+ 2
- 2
src/WebViewShared.tsx Näytä tiedosto

2
 import React from 'react';
2
 import React from 'react';
3
 import { Linking, View, ActivityIndicator, Text } from 'react-native';
3
 import { Linking, View, ActivityIndicator, Text } from 'react-native';
4
 import {
4
 import {
5
-  WebViewNavigationEvent,
6
   OnShouldStartLoadWithRequest,
5
   OnShouldStartLoadWithRequest,
6
+  ShouldStartLoadRequestEvent,
7
 } from './WebViewTypes';
7
 } from './WebViewTypes';
8
 import styles from './WebView.styles';
8
 import styles from './WebView.styles';
9
 
9
 
39
   originWhitelist: readonly string[],
39
   originWhitelist: readonly string[],
40
   onShouldStartLoadWithRequest?: OnShouldStartLoadWithRequest,
40
   onShouldStartLoadWithRequest?: OnShouldStartLoadWithRequest,
41
 ) => {
41
 ) => {
42
-  return ({ nativeEvent }: WebViewNavigationEvent) => {
42
+  return ({ nativeEvent }: ShouldStartLoadRequestEvent) => {
43
     let shouldStart = true;
43
     let shouldStart = true;
44
     const { url, lockIdentifier } = nativeEvent;
44
     const { url, lockIdentifier } = nativeEvent;
45
 
45
 

+ 97
- 10
src/WebViewTypes.ts Näytä tiedosto

113
   mainDocumentURL?: string;
113
   mainDocumentURL?: string;
114
 }
114
 }
115
 
115
 
116
+export interface ShouldStartLoadRequest extends WebViewNavigation {
117
+  isTopFrame: boolean;
118
+}
119
+
116
 export interface FileDownload {
120
 export interface FileDownload {
117
   downloadUrl: string;
121
   downloadUrl: string;
118
 }
122
 }
137
   statusCode: number;
141
   statusCode: number;
138
 }
142
 }
139
 
143
 
144
+export interface WebViewRenderProcessGoneDetail {
145
+  didCrash: boolean;
146
+}
147
+
140
 export type WebViewEvent = NativeSyntheticEvent<WebViewNativeEvent>;
148
 export type WebViewEvent = NativeSyntheticEvent<WebViewNativeEvent>;
141
 
149
 
142
 export type WebViewProgressEvent = NativeSyntheticEvent<
150
 export type WebViewProgressEvent = NativeSyntheticEvent<
145
 
153
 
146
 export type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
154
 export type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
147
 
155
 
156
+export type ShouldStartLoadRequestEvent = NativeSyntheticEvent<ShouldStartLoadRequest>;
157
+
148
 export type FileDownloadEvent = NativeSyntheticEvent<FileDownload>;
158
 export type FileDownloadEvent = NativeSyntheticEvent<FileDownload>;
149
 
159
 
150
 export type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
160
 export type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
155
 
165
 
156
 export type WebViewHttpErrorEvent = NativeSyntheticEvent<WebViewHttpError>;
166
 export type WebViewHttpErrorEvent = NativeSyntheticEvent<WebViewHttpError>;
157
 
167
 
168
+export type WebViewRenderProcessGoneEvent = NativeSyntheticEvent<WebViewRenderProcessGoneDetail>;
169
+
158
 export type DataDetectorTypes =
170
 export type DataDetectorTypes =
159
   | 'phoneNumber'
171
   | 'phoneNumber'
160
   | 'link'
172
   | 'link'
170
 
182
 
171
 export type CacheMode = 'LOAD_DEFAULT' | 'LOAD_CACHE_ONLY' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE';
183
 export type CacheMode = 'LOAD_DEFAULT' | 'LOAD_CACHE_ONLY' | 'LOAD_CACHE_ELSE_NETWORK' | 'LOAD_NO_CACHE';
172
 
184
 
185
+export type AndroidLayerType = 'none' | 'software' | 'hardware';
186
+
173
 export interface WebViewSourceUri {
187
 export interface WebViewSourceUri {
174
   /**
188
   /**
175
    * The URI to load in the `WebView`. Can be a local or remote file.
189
    * The URI to load in the `WebView`. Can be a local or remote file.
232
 }
246
 }
233
 
247
 
234
 export type OnShouldStartLoadWithRequest = (
248
 export type OnShouldStartLoadWithRequest = (
235
-  event: WebViewNavigation,
249
+  event: ShouldStartLoadRequest,
236
 ) => boolean;
250
 ) => boolean;
237
 
251
 
238
 export interface CommonNativeWebViewProps extends ViewProps {
252
 export interface CommonNativeWebViewProps extends ViewProps {
240
   incognito?: boolean;
254
   incognito?: boolean;
241
   injectedJavaScript?: string;
255
   injectedJavaScript?: string;
242
   injectedJavaScriptBeforeContentLoaded?: string;
256
   injectedJavaScriptBeforeContentLoaded?: string;
257
+  injectedJavaScriptForMainFrameOnly?: boolean;
258
+  injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
259
+  javaScriptCanOpenWindowsAutomatically?: boolean;
243
   mediaPlaybackRequiresUserAction?: boolean;
260
   mediaPlaybackRequiresUserAction?: boolean;
244
   messagingEnabled: boolean;
261
   messagingEnabled: boolean;
245
   onScroll?: (event: NativeScrollEvent) => void;
262
   onScroll?: (event: NativeScrollEvent) => void;
249
   onLoadingStart: (event: WebViewNavigationEvent) => void;
266
   onLoadingStart: (event: WebViewNavigationEvent) => void;
250
   onHttpError: (event: WebViewHttpErrorEvent) => void;
267
   onHttpError: (event: WebViewHttpErrorEvent) => void;
251
   onMessage: (event: WebViewMessageEvent) => void;
268
   onMessage: (event: WebViewMessageEvent) => void;
252
-  onShouldStartLoadWithRequest: (event: WebViewNavigationEvent) => void;
269
+  onShouldStartLoadWithRequest: (event: ShouldStartLoadRequestEvent) => void;
253
   showsHorizontalScrollIndicator?: boolean;
270
   showsHorizontalScrollIndicator?: boolean;
254
   showsVerticalScrollIndicator?: boolean;
271
   showsVerticalScrollIndicator?: boolean;
255
   // TODO: find a better way to type this.
272
   // TODO: find a better way to type this.
257
   source: any;
274
   source: any;
258
   userAgent?: string;
275
   userAgent?: string;
259
   /**
276
   /**
260
-   * Append to the existing user-agent. Overriden if `userAgent` is set.
277
+   * Append to the existing user-agent. Overridden if `userAgent` is set.
261
    */
278
    */
262
   applicationNameForUserAgent?: string;
279
   applicationNameForUserAgent?: string;
263
 }
280
 }
269
   allowFileAccessFromFileURLs?: boolean;
286
   allowFileAccessFromFileURLs?: boolean;
270
   allowUniversalAccessFromFileURLs?: boolean;
287
   allowUniversalAccessFromFileURLs?: boolean;
271
   androidHardwareAccelerationDisabled?: boolean;
288
   androidHardwareAccelerationDisabled?: boolean;
289
+  androidLayerType?: AndroidLayerType;
272
   domStorageEnabled?: boolean;
290
   domStorageEnabled?: boolean;
273
   geolocationEnabled?: boolean;
291
   geolocationEnabled?: boolean;
274
   javaScriptEnabled?: boolean;
292
   javaScriptEnabled?: boolean;
275
   mixedContentMode?: 'never' | 'always' | 'compatibility';
293
   mixedContentMode?: 'never' | 'always' | 'compatibility';
276
   onContentSizeChange?: (event: WebViewEvent) => void;
294
   onContentSizeChange?: (event: WebViewEvent) => void;
295
+  onRenderProcessGone?: (event: WebViewRenderProcessGoneEvent) => void;
277
   overScrollMode?: OverScrollModeType;
296
   overScrollMode?: OverScrollModeType;
278
   saveFormDataDisabled?: boolean;
297
   saveFormDataDisabled?: boolean;
279
   textZoom?: number;
298
   textZoom?: number;
282
   readonly urlPrefixesForDefaultIntent?: string[];
301
   readonly urlPrefixesForDefaultIntent?: string[];
283
 }
302
 }
284
 
303
 
285
-export enum ContentInsetAdjustmentBehavior {
286
-  automatic = 'automatic',
287
-  scrollableAxes = 'scrollableAxes',
288
-  never = 'never',
289
-  always = 'always'
290
-};
304
+export declare type ContentInsetAdjustmentBehavior = 'automatic' | 'scrollableAxes' | 'never' | 'always';
305
+
306
+export declare type ContentMode = 'recommended' | 'mobile' | 'desktop';
291
 
307
 
292
 export interface IOSNativeWebViewProps extends CommonNativeWebViewProps {
308
 export interface IOSNativeWebViewProps extends CommonNativeWebViewProps {
293
   allowingReadAccessToURL?: string;
309
   allowingReadAccessToURL?: string;
295
   allowsInlineMediaPlayback?: boolean;
311
   allowsInlineMediaPlayback?: boolean;
296
   allowsLinkPreview?: boolean;
312
   allowsLinkPreview?: boolean;
297
   automaticallyAdjustContentInsets?: boolean;
313
   automaticallyAdjustContentInsets?: boolean;
314
+  autoManageStatusBarEnabled?: boolean;
298
   bounces?: boolean;
315
   bounces?: boolean;
299
   contentInset?: ContentInsetProp;
316
   contentInset?: ContentInsetProp;
300
   contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
317
   contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
318
+  contentMode?: ContentMode;
301
   readonly dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[];
319
   readonly dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[];
302
   decelerationRate?: number;
320
   decelerationRate?: number;
303
   directionalLockEnabled?: boolean;
321
   directionalLockEnabled?: boolean;
395
    */
413
    */
396
   contentInset?: ContentInsetProp;
414
   contentInset?: ContentInsetProp;
397
 
415
 
416
+  /**
417
+   * Defaults to `recommended`, which loads mobile content on iPhone
418
+   * and iPad Mini but desktop content on other iPads.
419
+   *
420
+   * Possible values are:
421
+   * - `'recommended'`
422
+   * - `'mobile'`
423
+   * - `'desktop'`
424
+   * @platform ios
425
+   */
426
+  contentMode?: ContentMode;
427
+
398
   /**
428
   /**
399
    * Determines the types of data converted to clickable URLs in the web view's content.
429
    * Determines the types of data converted to clickable URLs in the web view's content.
400
    * By default only phone numbers are detected.
430
    * By default only phone numbers are detected.
469
    */
499
    */
470
   sharedCookiesEnabled?: boolean;
500
   sharedCookiesEnabled?: boolean;
471
 
501
 
502
+  /**
503
+   * Set true if StatusBar should be light when user watch video fullscreen.
504
+   * The default value is `true`.
505
+   * @platform ios
506
+   */
507
+  autoManageStatusBarEnabled?: boolean;
508
+
472
   /**
509
   /**
473
    * A Boolean value that determines whether scrolling is disabled in a particular direction.
510
    * A Boolean value that determines whether scrolling is disabled in a particular direction.
474
    * The default value is `true`.
511
    * The default value is `true`.
520
   */
557
   */
521
   injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
558
   injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
522
 
559
 
560
+  /**
561
+   * Boolean value that determines whether a pull to refresh gesture is
562
+   * available in the `WebView`. The default value is `false`.
563
+   * If `true`, sets `bounces` automatically to `true`
564
+   * @platform ios
565
+   *
566
+  */
567
+  pullToRefreshEnabled?: boolean;
568
+
523
   /**
569
   /**
524
    * Function that is invoked when the client needs to download a file.
570
    * Function that is invoked when the client needs to download a file.
525
    *
571
    *
680
   onNavigationStateChange?: (event: WebViewNavigation) => void;
726
   onNavigationStateChange?: (event: WebViewNavigation) => void;
681
   onContentSizeChange?: (event: WebViewEvent) => void;
727
   onContentSizeChange?: (event: WebViewEvent) => void;
682
 
728
 
729
+  /**
730
+   * Function that is invoked when the `WebView` process crashes or is killed by the OS.
731
+   * Works only on Android (minimum API level 26).
732
+   */
733
+  onRenderProcessGone?: (event: WebViewRenderProcessGoneEvent) => void;
734
+
683
   /**
735
   /**
684
    * https://developer.android.com/reference/android/webkit/WebSettings.html#setCacheMode(int)
736
    * https://developer.android.com/reference/android/webkit/WebSettings.html#setCacheMode(int)
685
    * Set the cacheMode. Possible values are:
737
    * Set the cacheMode. Possible values are:
718
    */
770
    */
719
   geolocationEnabled?: boolean;
771
   geolocationEnabled?: boolean;
720
 
772
 
721
-  
773
+
722
   /**
774
   /**
723
    * Boolean that sets whether JavaScript running in the context of a file
775
    * Boolean that sets whether JavaScript running in the context of a file
724
    * scheme URL should be allowed to access content from other file scheme URLs.
776
    * scheme URL should be allowed to access content from other file scheme URLs.
763
    */
815
    */
764
   androidHardwareAccelerationDisabled?: boolean;
816
   androidHardwareAccelerationDisabled?: boolean;
765
 
817
 
818
+    /**
819
+   * https://developer.android.com/reference/android/webkit/WebView#setLayerType(int,%20android.graphics.Paint)
820
+   * Sets the layerType. Possible values are:
821
+   *
822
+   * - `'none'` (default)
823
+   * - `'software'`
824
+   * - `'hardware'`
825
+   *
826
+   * @platform android
827
+   */
828
+  androidLayerType?: AndroidLayerType;
829
+
766
   /**
830
   /**
767
    * Boolean value to enable third party cookies in the `WebView`. Used on
831
    * Boolean value to enable third party cookies in the `WebView`. Used on
768
    * Android Lollipop and above only as third party cookies are enabled by
832
    * Android Lollipop and above only as third party cookies are enabled by
821
    */
885
    */
822
   javaScriptEnabled?: boolean;
886
   javaScriptEnabled?: boolean;
823
 
887
 
888
+  /**
889
+   * A Boolean value indicating whether JavaScript can open windows without user interaction.
890
+   * The default value is `false`.
891
+   */
892
+  javaScriptCanOpenWindowsAutomatically?: boolean;
893
+
824
   /**
894
   /**
825
    * Stylesheet object to set the style of the container view.
895
    * Stylesheet object to set the style of the container view.
826
    */
896
    */
908
    */
978
    */
909
   injectedJavaScriptBeforeContentLoaded?: string;
979
   injectedJavaScriptBeforeContentLoaded?: string;
910
 
980
 
981
+  /**
982
+   * If `true` (default; mandatory for Android), loads the `injectedJavaScript` only into the main frame.
983
+   * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
984
+   */
985
+  injectedJavaScriptForMainFrameOnly?: boolean;
986
+
987
+  /**
988
+   * If `true` (default; mandatory for Android), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
989
+   * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
990
+   */
991
+  injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
992
+
911
   /**
993
   /**
912
    * Boolean value that determines whether a horizontal scroll indicator is
994
    * Boolean value that determines whether a horizontal scroll indicator is
913
    * shown in the `WebView`. The default value is `true`.
995
    * shown in the `WebView`. The default value is `true`.
952
    * Should caching be enabled. Default is true.
1034
    * Should caching be enabled. Default is true.
953
    */
1035
    */
954
   cacheEnabled?: boolean;
1036
   cacheEnabled?: boolean;
1037
+
1038
+  /**
1039
+   * Append to the existing user-agent. Overridden if `userAgent` is set.
1040
+   */
1041
+  applicationNameForUserAgent?: string;
955
 }
1042
 }

+ 204
- 204
windows/ReactNativeWebView.sln Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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
-        m_reactContext.DispatchEvent(
133
-            m_webView,
134
-            L"topMessage",
135
-            [&](winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter) noexcept {
136
-                eventDataWriter.WriteObjectBegin();
137
-                {
138
-                    WriteProperty(eventDataWriter, L"data", winrt::to_string(args.Value()));
139
-                }
140
-                eventDataWriter.WriteObjectEnd();
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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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
-    IMapView<hstring, int64_t> ReactWebViewManager::Commands() noexcept {
105
-        auto commands = winrt::single_threaded_map<hstring, int64_t>();
106
-        commands.Insert(L"goForward", static_cast<int32_t>(WebViewCommands::GoForward));
107
-        commands.Insert(L"goBack", static_cast<int32_t>(WebViewCommands::GoBack));
108
-        commands.Insert(L"reload", static_cast<int32_t>(WebViewCommands::Reload));
109
-        commands.Insert(L"stopLoading", static_cast<int32_t>(WebViewCommands::StopLoading));
110
-        commands.Insert(L"injectJavaScript", static_cast<int32_t>(WebViewCommands::InjectJavaScript));
111
-        return commands.GetView();
112
-    }
113
-
114
-    void ReactWebViewManager::DispatchCommand(
115
-        FrameworkElement const& view,
116
-        int64_t commandId,
117
-        winrt::IJSValueReader const& commandArgsReader) noexcept {
118
-        auto commandArgs = JSValue::ReadArrayFrom(commandArgsReader);
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", { winrt::to_hstring(commandArgs[0].AsString()) });
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 Näytä tiedosto

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 Näytä tiedosto

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 Näytä tiedosto

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

+ 13
- 13
windows/ReactNativeWebView/pch.h Näytä tiedosto

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
- 14445
yarn.lock
File diff suppressed because it is too large
Näytä tiedosto