@exodus/react-native-webview 11.26.1-exodus.5 → 11.26.1-exodus.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/.all-contributorsrc +185 -0
  2. package/.circleci/config.yml +66 -0
  3. package/.eslintignore +2 -0
  4. package/.eslintrc.js +94 -0
  5. package/.flowconfig +88 -0
  6. package/.flowconfig.android +88 -0
  7. package/.gitattributes +12 -0
  8. package/.github/CODEOWNERS +1 -0
  9. package/.github/ISSUE_TEMPLATE/bug-report.md +42 -0
  10. package/.github/ISSUE_TEMPLATE/feature_request.md +30 -0
  11. package/.github/workflows/android-ci.yml +35 -0
  12. package/.github/workflows/detox.yml +20 -0
  13. package/.github/workflows/ios-ci.yml +31 -0
  14. package/.github/workflows/scripts/install-vs-features.ps1 +108 -0
  15. package/.github/workflows/stale.yml +17 -0
  16. package/.gitignore +62 -0
  17. package/.prettierrc.js +10 -0
  18. package/.releaserc +15 -0
  19. package/.vscode/settings.json +9 -0
  20. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  21. package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  22. package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
  23. package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
  24. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  25. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  26. package/android/.gradle/7.4.2/gc.properties +0 -0
  27. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  28. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  29. package/android/.gradle/vcs-1/gc.properties +0 -0
  30. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewPackage.java +25 -0
  31. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewUtils.java +51 -0
  32. package/babel.config.js +11 -0
  33. package/bin/setup +26 -0
  34. package/docs/Contributing.md +102 -0
  35. package/docs/Custom-Android.md +222 -0
  36. package/docs/Custom-iOS.md +236 -0
  37. package/docs/Debugging.md +101 -0
  38. package/docs/Getting-Started.md +142 -0
  39. package/docs/Guide.md +613 -0
  40. package/docs/Reference.md +1629 -0
  41. package/example/.gitignore +14 -0
  42. package/example/.watchmanconfig +1 -0
  43. package/example/App.tsx +262 -0
  44. package/example/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
  45. package/example/android/.gradle/7.3.3/checksums/md5-checksums.bin +0 -0
  46. package/example/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
  47. package/example/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
  48. package/example/android/.gradle/7.3.3/dependencies-accessors/gc.properties +0 -0
  49. package/example/android/.gradle/7.3.3/fileChanges/last-build.bin +0 -0
  50. package/example/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
  51. package/example/android/.gradle/7.3.3/gc.properties +0 -0
  52. package/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  53. package/example/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  54. package/example/android/.gradle/vcs-1/gc.properties +0 -0
  55. package/example/android/build.gradle +15 -0
  56. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  57. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  58. package/example/android/gradle.properties +34 -0
  59. package/example/android/gradlew +234 -0
  60. package/example/android/gradlew.bat +89 -0
  61. package/example/android/settings.gradle +12 -0
  62. package/example/app.json +20 -0
  63. package/example/assets/test.html +9 -0
  64. package/example/babel.config.js +3 -0
  65. package/example/examples/Alerts.tsx +72 -0
  66. package/example/examples/ApplePay.tsx +23 -0
  67. package/example/examples/Background.tsx +54 -0
  68. package/example/examples/Downloads.tsx +57 -0
  69. package/example/examples/Injection.tsx +161 -0
  70. package/example/examples/LocalPageLoad.tsx +16 -0
  71. package/example/examples/Messaging.tsx +63 -0
  72. package/example/examples/NativeWebpage.tsx +22 -0
  73. package/example/examples/Scrolling.tsx +68 -0
  74. package/example/examples/Uploads.tsx +69 -0
  75. package/example/index.js +9 -0
  76. package/example/ios/Podfile +8 -0
  77. package/example/ios/Podfile.lock +445 -0
  78. package/index.js +5 -2
  79. package/ios/Podfile +10 -0
  80. package/ios/Podfile.lock +3 -0
  81. package/ios/Pods/Manifest.lock +3 -0
  82. package/ios/Pods/Pods.xcodeproj/project.pbxproj +397 -0
  83. package/ios/Pods/Pods.xcodeproj/xcuserdata/gabrielezenwankwo.xcuserdatad/xcschemes/Pods-RNCWebView.xcscheme +58 -0
  84. package/ios/Pods/Pods.xcodeproj/xcuserdata/gabrielezenwankwo.xcuserdatad/xcschemes/xcschememanagement.plist +16 -0
  85. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView-Info.plist +26 -0
  86. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView-acknowledgements.markdown +3 -0
  87. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView-acknowledgements.plist +29 -0
  88. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView-dummy.m +5 -0
  89. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView-umbrella.h +16 -0
  90. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView.debug.xcconfig +8 -0
  91. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView.modulemap +6 -0
  92. package/ios/Pods/Target Support Files/Pods-RNCWebView/Pods-RNCWebView.release.xcconfig +8 -0
  93. package/ios/RNCWebView.xcworkspace/contents.xcworkspacedata +32 -0
  94. package/jest-setups/jest.setup.js +8 -0
  95. package/jest.config.js +184 -0
  96. package/lib/UpdateOS.d.ts +6 -0
  97. package/lib/UpdateOS.d.ts.map +1 -0
  98. package/lib/UpdateOS.js +49 -0
  99. package/lib/WebView.android.d.ts.map +1 -0
  100. package/lib/WebView.android.js +19 -3
  101. package/lib/WebView.d.ts.map +1 -0
  102. package/lib/WebView.ios.d.ts.map +1 -0
  103. package/lib/WebView.ios.js +5 -2
  104. package/lib/WebView.styles.d.ts.map +1 -0
  105. package/lib/WebViewNativeComponent.android.d.ts.map +1 -0
  106. package/lib/WebViewNativeComponent.ios.d.ts.map +1 -0
  107. package/lib/WebViewShared.d.ts.map +1 -0
  108. package/lib/WebViewTypes.d.ts +5 -1
  109. package/lib/WebViewTypes.d.ts.map +1 -0
  110. package/lib/index.d.ts.map +1 -0
  111. package/metro.config.js +57 -0
  112. package/package.json +1 -1
  113. package/src/WebView.android.tsx +246 -0
  114. package/src/WebView.ios.tsx +221 -0
  115. package/src/WebView.styles.ts +44 -0
  116. package/src/WebView.tsx +18 -0
  117. package/src/WebViewNativeComponent.android.ts +8 -0
  118. package/src/WebViewNativeComponent.ios.ts +8 -0
  119. package/src/WebViewShared.tsx +257 -0
  120. package/src/WebViewTypes.ts +914 -0
  121. package/src/__tests__/WebViewShared-test.js +208 -0
  122. package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +8 -0
  123. package/src/index.ts +4 -0
  124. package/tsconfig.json +24 -0
  125. package/yarn.lock +13895 -0
  126. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewPackage.kt +0 -15
@@ -0,0 +1,31 @@
1
+ name: iOS
2
+ on: [push, pull_request]
3
+ jobs:
4
+ build:
5
+ runs-on: macos-latest
6
+ steps:
7
+ - name: Checkout
8
+ uses: actions/checkout@v2
9
+ - name: Set up Node.js
10
+ uses: actions/setup-node@v2.5.1
11
+ with:
12
+ node-version: 16
13
+ - name: Cache /node_modules
14
+ uses: actions/cache@v2
15
+ with:
16
+ path: node_modules
17
+ key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
18
+ - name: Install npm dependencies
19
+ run: yarn --frozen-lockfile
20
+ - name: Install Pods
21
+ run: pod install
22
+ working-directory: example/ios
23
+ - name: Build iOS test app
24
+ run: |
25
+ device_name='iPhone 13'
26
+ device=$(xcrun simctl list devices "${device_name}" available | grep "${device_name} (")
27
+ re='\(([-0-9A-Fa-f]+)\)'
28
+ [[ $device =~ $re ]] || exit 1
29
+ xcodebuild -workspace WebviewExample.xcworkspace -scheme ReactTestApp -destination "platform=iOS Simulator,id=${BASH_REMATCH[1]}" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO build
30
+ working-directory: example/ios
31
+ timeout-minutes: 60
@@ -0,0 +1,108 @@
1
+ param (
2
+ [Parameter(Mandatory=$true)]
3
+ [string[]] $Components,
4
+
5
+ [uri] $InstallerUri = "https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe",
6
+
7
+ [string] $VsInstaller = "${env:System_DefaultWorkingDirectory}\vs_Enterprise.exe",
8
+
9
+ [string] $VsInstallOutputDir = "${env:System_DefaultWorkingDirectory}\vs",
10
+
11
+ [System.IO.FileInfo] $VsInstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise",
12
+
13
+ [System.IO.FileInfo] $VsInstallerPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer",
14
+
15
+ [switch] $Collect = $false,
16
+
17
+ [switch] $Cleanup = $false,
18
+
19
+ [switch] $UseWebInstaller = $false
20
+ )
21
+
22
+ $Components | ForEach-Object {
23
+ $componentList += '--add', $_
24
+ }
25
+
26
+ $LocalVsInstaller = "$VsInstallerPath\vs_installershell.exe"
27
+
28
+ $UseWebInstaller = $UseWebInstaller -or -not (Test-Path -Path "$LocalVsInstaller")
29
+
30
+ if ($UseWebInstaller) {
31
+ Write-Host "Downloading web installer..."
32
+
33
+ Invoke-WebRequest -Method Get `
34
+ -Uri $InstallerUri `
35
+ -OutFile $VsInstaller
36
+
37
+ New-Item -ItemType directory -Path $VsInstallOutputDir
38
+
39
+ Write-Host "Running web installer to download requested components..."
40
+
41
+ Start-Process `
42
+ -FilePath "$VsInstaller" `
43
+ -ArgumentList ( `
44
+ '--layout', "$VsInstallOutputDir",
45
+ '--wait',
46
+ '--norestart',
47
+ '--quiet' + `
48
+ $componentList
49
+ ) `
50
+ -Wait `
51
+ -PassThru
52
+
53
+ Write-Host "Running downloaded VS installer to add requested components..."
54
+
55
+ Start-Process `
56
+ -FilePath "$VsInstallOutputDir\vs_Enterprise.exe" `
57
+ -ArgumentList (
58
+ 'modify',
59
+ '--installPath', "`"$VsInstallPath`"" ,
60
+ '--wait',
61
+ '--norestart',
62
+ '--quiet' + `
63
+ $componentList
64
+ ) `
65
+ -Wait `
66
+ -PassThru `
67
+ -OutVariable returnCode
68
+
69
+ if ($Cleanup) {
70
+ Write-Host "Cleaning up..."
71
+
72
+ Remove-Item -Path $VsInstaller
73
+ Remove-Item -Path $VsInstallOutputDir -Recurse
74
+ }
75
+
76
+ } else {
77
+ Write-Host "Running local installer to add requested components..."
78
+
79
+ Start-Process `
80
+ -FilePath "$LocalVsInstaller" `
81
+ -ArgumentList (
82
+ 'modify',
83
+ '--installPath', "`"$VsInstallPath`"" ,
84
+ '--norestart',
85
+ '--quiet' + `
86
+ $componentList
87
+ ) `
88
+ -Wait `
89
+ -OutVariable returnCode
90
+ }
91
+
92
+ if ($Collect) {
93
+ Invoke-WebRequest -Method Get `
94
+ -Uri 'https://download.microsoft.com/download/8/3/4/834E83F6-C377-4DCE-A757-69A418B6C6DF/Collect.exe' `
95
+ -OutFile ${env:System_DefaultWorkingDirectory}\Collect.exe
96
+
97
+ # Should generate ${env:Temp}\vslogs.zip
98
+ Start-Process `
99
+ -FilePath "${env:System_DefaultWorkingDirectory}\Collect.exe" `
100
+ -Wait `
101
+ -PassThru
102
+
103
+ New-Item -ItemType Directory -Force ${env:System_DefaultWorkingDirectory}\vslogs
104
+ Expand-Archive -Path ${env:TEMP}\vslogs.zip -DestinationPath ${env:System_DefaultWorkingDirectory}\vslogs\
105
+
106
+ Write-Host "VC versions after installation:"
107
+ Get-ChildItem -Name "$VsInstallPath\VC\Tools\MSVC\"
108
+ }
@@ -0,0 +1,17 @@
1
+ name: "Close stale issues and PRs"
2
+ on:
3
+ schedule:
4
+ - cron: "0 0 * * *"
5
+
6
+ jobs:
7
+ stale:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/stale@v3.0.14
11
+ with:
12
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
13
+ stale-issue-message: 'Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like _still searching for solutions_ and if you found one, please open a pull request! You have 7 days until this gets closed automatically'
14
+ stale-pr-message: 'Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically'
15
+ exempt-issue-label: 'Keep opened'
16
+ exempt-pr-label: 'Keep opened'
17
+ remove-stale-when-updated: true
package/.gitignore ADDED
@@ -0,0 +1,62 @@
1
+ # OSX
2
+ #
3
+ .DS_Store
4
+
5
+ # Xcode
6
+ #
7
+ .xcode.env
8
+ build/
9
+ *.pbxuser
10
+ !default.pbxuser
11
+ *.mode1v3
12
+ !default.mode1v3
13
+ *.mode2v3
14
+ !default.mode2v3
15
+ *.perspectivev3
16
+ !default.perspectivev3
17
+ xcuserdata
18
+ *.xccheckout
19
+ *.moved-aside
20
+ DerivedData
21
+ *.hmap
22
+ *.ipa
23
+ *.xcuserstate
24
+ project.xcworkspace
25
+ Pods/
26
+
27
+ # Android/IJ
28
+ #
29
+ .idea
30
+ *.iml
31
+ .gradle
32
+ local.properties
33
+ lib/android/src/main/gen
34
+
35
+ # node.js
36
+ #
37
+ node_modules/
38
+ npm-debug.log
39
+ yarn-error.log
40
+ package-lock.json
41
+
42
+ # Rubygem bundles
43
+ #
44
+ bundles/
45
+
46
+ # VS Code
47
+ .vscode/*
48
+ !.vscode/settings.json
49
+ !.vscode/tasks.json
50
+ !.vscode/launch.json
51
+ !.vscode/extensions.json
52
+
53
+ android/gradle
54
+ android/gradlew
55
+ android/gradlew.bat
56
+
57
+ lib/
58
+ .classpath
59
+ .project
60
+ .settings/
61
+ msbuild.binlog
62
+ example/msbuild.binlog
package/.prettierrc.js ADDED
@@ -0,0 +1,10 @@
1
+ // https://prettier.io/docs/en/options.html
2
+
3
+ module.exports = {
4
+ // Enables semicolons at the end of statements
5
+ semi: true,
6
+ // Formats strings with single quotes ('') instead of quotes ("")
7
+ singleQuote: true,
8
+ // Adds a trailing comma at the end of all lists (including function arguments)
9
+ trailingComma: 'all',
10
+ };
package/.releaserc ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "plugins": [
3
+ "@semantic-release/commit-analyzer",
4
+ "@semantic-release/release-notes-generator",
5
+ "@semantic-release/npm",
6
+ "@semantic-release/github",
7
+ [
8
+ "@semantic-release/git",
9
+ {
10
+ "assets": "package.json",
11
+ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12
+ }
13
+ ]
14
+ ]
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "typescript.tsdk": "node_modules/typescript/lib",
3
+ "eslint.validate": [
4
+ "javascript",
5
+ "javascriptreact",
6
+ "typescript",
7
+ "typescriptreact"
8
+ ]
9
+ }
File without changes
@@ -0,0 +1,2 @@
1
+ #Fri Mar 24 15:04:57 WAT 2023
2
+ gradle.version=7.4.2
File without changes
@@ -0,0 +1,25 @@
1
+ package com.reactnativecommunity.webview;
2
+
3
+ import java.util.Arrays;
4
+ import java.util.Collections;
5
+ import java.util.List;
6
+
7
+ import com.facebook.react.ReactPackage;
8
+ import com.facebook.react.bridge.NativeModule;
9
+ import com.facebook.react.bridge.ReactApplicationContext;
10
+ import com.facebook.react.uimanager.ViewManager;
11
+
12
+ public class RNCWebViewPackage implements ReactPackage {
13
+ @Override
14
+ public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
15
+ return Arrays.<NativeModule>asList(
16
+ new RNCWebViewModule(reactContext),
17
+ new RNCWebViewUtils(reactContext)
18
+ );
19
+ }
20
+
21
+ @Override
22
+ public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
23
+ return Arrays.<ViewManager>asList(new RNCWebViewManager());
24
+ }
25
+ }
@@ -0,0 +1,51 @@
1
+ package com.reactnativecommunity.webview;
2
+
3
+ import android.webkit.WebView;
4
+
5
+ import com.facebook.react.bridge.Promise;
6
+ import com.facebook.react.bridge.ReactApplicationContext;
7
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
+ import com.facebook.react.uimanager.ThemedReactContext;
9
+ import com.facebook.react.bridge.ReactMethod;
10
+ import com.facebook.react.bridge.UiThreadUtil;
11
+
12
+ public class RNCWebViewUtils extends ReactContextBaseJavaModule {
13
+ public static final String NAME = "RNCWebViewUtils";
14
+
15
+ ReactApplicationContext mCallerContext;
16
+
17
+ public RNCWebViewUtils(ReactApplicationContext reactContext) {
18
+ super(reactContext);
19
+ mCallerContext = reactContext;
20
+ }
21
+
22
+ @Override
23
+ public String getName() {
24
+ return NAME;
25
+ }
26
+
27
+ @ReactMethod
28
+ public void getWebViewDefaultUserAgent(final Promise promise) {
29
+ UiThreadUtil.runOnUiThread(new Runnable() {
30
+ @Override
31
+ public void run() {
32
+ try {
33
+ WebView webView = new WebView(mCallerContext);
34
+
35
+ // in case we ever use our own UA we need to unset it first the get the original
36
+ String currentUA = webView.getSettings().getUserAgentString();
37
+ webView.getSettings().setUserAgentString(null);
38
+ String webViewUA = webView.getSettings().getUserAgentString();
39
+
40
+ // Revert to overriden UA string
41
+ webView.getSettings().setUserAgentString(currentUA);
42
+
43
+ promise.resolve(webViewUA);
44
+ }
45
+ catch (Exception e) {
46
+ promise.reject(NAME, e.getMessage());
47
+ }
48
+ }
49
+ });
50
+ }
51
+ }
@@ -0,0 +1,11 @@
1
+ module.exports = function(api) {
2
+ api && api.cache(false);
3
+ return {
4
+ env: {
5
+ test: {
6
+ presets: ['module:metro-react-native-babel-preset'],
7
+ },
8
+ },
9
+ presets: ['module:metro-react-native-babel-preset'],
10
+ };
11
+ };
package/bin/setup ADDED
@@ -0,0 +1,26 @@
1
+ #! /bin/bash
2
+
3
+ # Node installed?
4
+ if ! [ -x "$(command -v node)" ]; then
5
+ echo 'Error: node is not installed.' >&2
6
+
7
+ if ! [ -x "$(command -v brew)" ]; then
8
+ echo 'Go here to install: https://nodejs.org/en/download/'
9
+ fi
10
+
11
+ if [ -x "$(command -v brew)" ]; then
12
+ echo 'You have Homebrew installed, so run "brew install node".'
13
+ fi
14
+
15
+ exit 1
16
+ fi
17
+
18
+ # React Native installed?
19
+ if ! [ -x "$(command -v react-native)" ]; then
20
+ echo 'Error: React Native is not installed.' >&2
21
+ echo 'Go here: https://reactnative.dev/docs/getting-started.html' >&2
22
+ echo 'Use the "Building Projects With Native Code" option.'
23
+ exit 1
24
+ fi
25
+
26
+ # TODO: Automate setup on new machines
@@ -0,0 +1,102 @@
1
+ # Contributing to React Native WebView
2
+
3
+ First off, _thank you_ for considering contributing to the React Native Community. The community-supported packages are only possible because of amazing people like you.
4
+
5
+ Secondly, we'd like the contribution experience to be as good as possible. While we are a small all-volunteer team, we are happy to hear feedback about your experience, and if we can make the docs or experience better please let us know.
6
+
7
+ ## How to test changes
8
+
9
+ After you fork the repo, clone it to your machine, and make your changes, you'll want to test them in an app.
10
+
11
+ There are two methods of testing:
12
+ 1) Testing within a clone of react-native-webview
13
+ 2) Testing in a new `react-native init` project
14
+
15
+ ### Testing within react-native-webview
16
+
17
+ #### For all platforms:
18
+
19
+ ```sh
20
+ yarn install
21
+ ```
22
+
23
+ #### For Android:
24
+
25
+ ```sh
26
+ yarn android
27
+ ```
28
+
29
+ The Android example app will built, the Metro Bundler will launch, and the example app will be installed and started in the Android emulator.
30
+
31
+ #### For iOS:
32
+
33
+ ```sh
34
+ pod install --project-directory=ios
35
+ yarn ios
36
+ ```
37
+
38
+ The iOS example app will be built, the Metro bundler will launch, and the example app will be installed and started in the Simulator.
39
+
40
+ #### For macOS:
41
+
42
+ ```sh
43
+ pod install --project-directory=macos
44
+ yarn macos
45
+ ```
46
+
47
+ The macOS example app will be built, the Metro bundler will launch, and the example app will be installed and started.
48
+
49
+ #### For Windows:
50
+
51
+ ```sh
52
+ yarn windows
53
+ ```
54
+
55
+ The Windows example app will be built, the Metro bundler will launch, and the example app will be installed and started.
56
+
57
+ ### Testing in a new `react-native init` project
58
+
59
+ In a new `react-native init` project, do this:
60
+
61
+ ```
62
+ $ yarn add ../react-native-webview
63
+ $ react-native link react-native-webview
64
+ ```
65
+
66
+ You may run into a problem where the `jest-haste-map` module map says react-native was added twice:
67
+
68
+ ```
69
+ Loading dependency graph...(node:32651) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
70
+ Duplicate module name: react-native
71
+ Paths: /Users/myuser/TestApp/node_modules/react-native/package.json collides with /Users/myuser/TestApp/node_modules/react-native-webview/node_modules/react-native/package.json
72
+ ```
73
+
74
+ Just remove the second path like this:
75
+
76
+ ```
77
+ $ rm -rf ./node_modules/react-native-webview/node_modules/react-native
78
+ ```
79
+
80
+ And then re-run the packager:
81
+
82
+ ```
83
+ $ react-native start --reset-cache
84
+ ```
85
+
86
+ When you make a change, you'll probably need to unlink, remove, re-add, and re-link `react-native-webview`:
87
+
88
+ ```
89
+ $ react-native unlink react-native-webview && yarn remove react-native-webview
90
+ $ yarn add ../react-native-webview && react-native link react-native-webview
91
+ ```
92
+
93
+ ## Notes
94
+
95
+ - We use TypeScript.
96
+ - After pulling this repo and installing all dependencies, you can run tests using the command: `yarn ci`
97
+
98
+ ## Translations
99
+
100
+ This file is available at:
101
+
102
+ - [Brazilian portuguese](Contributing.portuguese.md)