├── .eslintignore ├── .eslintrc.js ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .prettierrc.js ├── LICENSE ├── README.md ├── README_old.md ├── autoHeightWebView ├── index.js └── utils.js ├── demo ├── .buckconfig ├── .bundle │ └── config ├── .editorconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── App.js ├── Gemfile ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── demo │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── demo │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── newarchitecture │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ ├── components │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ └── modules │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ ├── jni │ │ │ ├── Android.mk │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ ├── MainApplicationModuleProvider.h │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ ├── MainComponentsRegistry.cpp │ │ │ ├── MainComponentsRegistry.h │ │ │ └── OnLoad.cpp │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── config.js ├── index.js ├── ios │ ├── .xcode.env │ ├── Podfile │ ├── Podfile.lock │ ├── demo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── demo.xcscheme │ ├── demo.xcworkspace │ │ └── contents.xcworkspacedata │ ├── demo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── demoTests │ │ ├── Info.plist │ │ └── demoTests.m ├── metro.config.js ├── package.json └── yarn.lock ├── index.d.ts ├── index.js ├── package-lock.json └── package.json /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | rules: { 5 | 'comma-dangle': 'off', 6 | 'no-unused-vars': 'error' 7 | } 8 | }; -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: iou90 7 | 8 | --- 9 | 10 | **Bug description:** 11 | 12 | **To Reproduce:** 13 | 14 | **Source (static HTML or url):** 15 | 16 | **Expected behavior:** 17 | 18 | **Screenshots/Videos:** 19 | 20 | **Environment:** 21 | - OS: 22 | - OS version: 23 | - react-native version: 24 | - react-native-webview version: 25 | - react-native-autoheight-webview version: 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: feature request 6 | assignees: iou90 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? If so, Please describe.** 11 | 12 | **Describe the solutions you came up with** 13 | 14 | **Platform targeting (iOS/Android)** 15 | 16 | **Additional context** 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | android/app/libs 42 | android/keystores/debug.keystore 43 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License (ISC) 2 | 3 | Copyright 2017 iou90 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any purpose 6 | with or without fee is hereby granted, provided that the above copyright notice 7 | and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 13 | OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 14 | TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 15 | THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-autoheight-webview 2 | 3 | An auto height webview for React Native, even auto width for inline html. 4 | 5 | [![NPM Version](http://img.shields.io/npm/v/react-native-autoheight-webview.svg?style=flat-square)](https://www.npmjs.com/package/react-native-autoheight-webview) 6 | [![NPM Downloads](https://img.shields.io/npm/dt/react-native-autoheight-webview.svg?style=flat-square)](https://www.npmjs.com/package/react-native-autoheight-webview) 7 | 8 | ## versioning 9 | 10 | `npm install react-native-autoheight-webview --save` (rn >= 0.60, rnw >= 10.9.0) 11 | 12 | `npm install react-native-autoheight-webview@1.0.1 --save` (0.57 <= rn < 0.59) 13 | 14 | `npm install react-native-autoheight-webview@1.5.2 --save` (0.59 <= rn < 0.60, 5.4.0 <= rnw < 10.9.0) 15 | 16 | Read [README_old](./README_old.md) for earlier version guide and please note that fixes and new features will only be included in the last version. 17 | 18 | ## showcase 19 | 20 | ![react-native-autoheight-webview iOS](https://media.giphy.com/media/tocJYDUGCgwac0kkyB/giphy.gif)  21 | ![react-native-autoheight-webview Android](https://media.giphy.com/media/9JyX1wZshYIxuPklHK/giphy.gif) 22 | 23 | ## usage 24 | 25 | react-native-webview is a peer dependency and must be installed along this lib. 26 | ``` 27 | npm install react-native-autoheight-webview react-native-webview 28 | ``` 29 | 30 | ```javascript 31 | import AutoHeightWebView from 'react-native-autoheight-webview' 32 | 33 | import { Dimensions } from 'react-native' 34 | 35 | console.log(size.height)} 47 | files={[{ 48 | href: 'cssfileaddress', 49 | type: 'text/css', 50 | rel: 'stylesheet' 51 | }]} 52 | source={{ html: `

Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with “moving”. I’d also use the tags “pets”, “marriage”, “career change”, and “travel tips”.

` }} 53 | scalesPageToFit={true} 54 | viewportContent={'width=device-width, user-scalable=no'} 55 | /* 56 | other react-native-webview props 57 | */ 58 | /> 59 | ``` 60 | 61 | ## properties 62 | 63 | | Prop | Default | Type | Description | 64 | | :--------------------------- | :-----: | :-------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 65 | | __style__ | - | `ViewPropTypes.style` | The width of this component will be the width of screen by default, if there are some text selection issues on iOS, the width should be reduced more than 15 and the marginTop should be added more than 35. | 66 | | __customScript__ | - | `PropTypes.string` | - | 67 | | __customStyle__ | - | `PropTypes.string` | The custom css content will be added to the page's ``. | 68 | | __onSizeUpdated__ | - | `PropTypes.func` | Either updated height or width will trigger onSizeUpdated. | 69 | | __files__ | - | `PropTypes.arrayOf(PropTypes.shape({ href: PropTypes.string, type: PropTypes.string, rel: PropTypes.string }))` | Using local or remote files. To add local files: Add files to android/app/src/main/assets/ (depends on baseUrl) on android; add files to web/ (depends on baseUrl) on iOS. | 70 | | __source__ | - | `PropTypes.object` | BaseUrl now contained by source. 'web/' by default on iOS; 'file:///android_asset/' by default on Android or uri. | 71 | | __scalesPageToFit__ | false | `PropTypes.bool` | False by default (different from react-native-webview which true by default on Android). When scalesPageToFit was enabled, it will apply the scale of the page directly. | 72 | | __scrollEnabledWithZoomedin__ | false | `PropTypes.bool` | Making the webview scrollable on iOS when zoomed in even if scrollEnabled is false. | 73 | | __viewportContent__ | 'width=device-width' on iOS | `PropTypes.string` | Please note that 'width=device-width' with scalesPageToFit may cause some layout issues on Android, for these conditions, using __customScript__ prop to apply custom viewport meta. | 74 | | __showsVerticalScrollIndicator__ | false | `PropTypes.bool` | False by default (different from react-native-webview). | 75 | | __showsHorizontalScrollIndicator__ | false | `PropTypes.bool` | False by default (different from react-native-webview). | 76 | | __originWhitelist__ | ['*'] | `PropTypes.arrayOf(PropTypes.string)` | Validate any origin by default cause of most cases using static HTML concerns. | 77 | 78 | ## demo 79 | 80 | ``` 81 | npx react-native run-ios/android 82 | ``` 83 | 84 | You may have to use yarn to install the dependencies of the demo and remove "demo/node_modules/react-native-autoheight-webview/demo" manually, cause of installing a local package with npm will create symlink, but there is no supporting of React Native to symlink (https://github.com/facebook/watchman/issues/105) and "yarn install" ignores "files" from local dependencies (https://github.com/yarnpkg/yarn/issues/2822). 85 | For android, you may have to copy the "Users\UserName\.android\debug.keystore" to "demo/android/app/". 86 | 87 | ## supporting rnahw 88 | 89 | One-time donation via PayPal: 90 | 91 | [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/iou90) 92 | -------------------------------------------------------------------------------- /README_old.md: -------------------------------------------------------------------------------- 1 | # react-native-autoheight-webview 2 | An auto height webview for React Native, or even auto width for inline html. 3 | 4 | The Current version do not support Android API version 18 and below and the native module has been removed. 5 | 6 | Cause of javascript execution in webview is not working for Android API version 21 and below (https://github.com/facebook/react-native/issues/14754#issuecomment-361841219), auto width for inline html will not work on Android with API version 22 and below. 7 | 8 | Cause of changes to lifecycle methods in React 16.3.0 (https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html), please install react-native-autoheight-webview 0.6.1 for the project with 0.47 <= rn < 0.55 9 | 10 | Cause of removing unused createJSModules calls in React Naitve 0.47 (https://github.com/facebook/react-native/releases/tag/v0.47.2), please install react-native-autoheight-webview 0.3.1 for the project with 0.44 <= rn < 0.47. 11 | 12 | Cause of moving View.propTypes to ViewPropTypes in React Naitve 0.44 (https://github.com/facebook/react-native/releases/tag/v0.44.3) and PropTypes has been moved to a separate package in React 16 (https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes), please install react-native-autoheight-webview 0.2.3 for the project with rn < 0.44. 13 | 14 | `npm install react-native-autoheight-webview --save` (rn >= 0.56) 15 | 16 | `npm install react-native-autoheight-webview@0.6.1 --save` (0.47 <= rn < 0.56) 17 | 18 | `npm install react-native-autoheight-webview@0.3.1 --save` (0.44 <= rn < 0.47) 19 | 20 | `npm install react-native-autoheight-webview@0.2.3 --save` (rn < 0.44) 21 | 22 | ## Android 23 | `react-native link react-native-autoheight-webview` (version 0.10.6 and below) 24 | 25 | `import AutoHeightWebView from 'react-native-autoheight-webview';` 26 | 27 | ## iOS 28 | `import AutoHeightWebView from 'react-native-autoheight-webview';` 29 | 30 | ## showcase 31 | ![react-native-autoheight-webview iOS](https://media.giphy.com/media/eehXhFjneVqEUCzYip/giphy.gif)  32 | ![react-native-autoheight-webview Android](https://media.giphy.com/media/1yTcqipIfHbgNNfcEU/giphy.gif) 33 | 34 | ## usage 35 | 36 | ```javascript 37 | 43 | customStyle={` 44 | * { 45 | font-family: 'Times New Roman'; 46 | } 47 | p { 48 | font-size: 16px; 49 | } 50 | `} 51 | // animation enabled by default 52 | enableAnimation={false}, 53 | // only works on enable animation 54 | animationDuration={255}, 55 | // offset of rn webview margin 56 | heightOffset={5} 57 | onMessage={e => console.log(e)}, 58 | // either height or width updated will trigger this 59 | // no support auto width and height will triggered by source changing only on android 5.1 or below version 60 | onSizeUpdated={({size => console.log(size.height)})}, 61 | // 'file:///android_asset/web/' by default on android, 62 | // web/' by default on iOS 63 | baseUrl: 'webAssets/', 64 | /* 65 | use local or remote files 66 | to add local files: 67 | add baseUrl/files... to android/app/src/assets/ on android 68 | add baseUrl/files... to project root on iOS 69 | */ 70 | files={[{ 71 | href: 'cssfileaddress', 72 | type: 'text/css', 73 | rel: 'stylesheet' 74 | }]} 75 | // if set to true may cause some layout issues (smaller font size) on iOS 76 | // if set to false may cause some layout issues (width of container will be than width of screen) on android 77 | scalesPageToFit={Platform.OS === 'Android' ? true : false} 78 | // or uri 79 | source={{ html: `

Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with “moving”. I’d also use the tags “pets”, “marriage”, “career change”, and “travel tips”.

` }} 80 | // rn WebView callbacks 81 | onError={() => console.log('on error')} 82 | onLoad={() => console.log('on load')} 83 | onLoadStart={() => console.log('on load start')} 84 | onLoadEnd={() => console.log('on load end')} 85 | onNavigationStateChange={() => console.log('navigation state changed')} 86 | // set scrollEnabled to true may cause some layout issues 87 | // only on iOS 88 | scrollEnabled={true}, 89 | // if page contains iframe on iOS, use a specific script for it 90 | // only on iOS 91 | hasIframe={true} 92 | // only on iOS 93 | onShouldStartLoadWithRequest={result => { 94 | console.log(result) 95 | return true; 96 | }} 97 | // only on Android for animating size (>= api 23) 98 | animationEasing={Easing.ease()} 99 | /* 100 | other rn WebView props: 101 | renderError, mediaPlaybackRequiresUserAction, originWhitelist 102 | decelerationRate, allowsInlineMediaPlayback, bounces, dataDetectorTypes on iOS 103 | domStorageEnabled, thirdPartyCookiesEnabled, userAgent, geolocationEnabled, allowUniversalAccessFromFileURLs, mixedContentMode on Android 104 | */ 105 | /> 106 | ``` 107 | 108 | ## demo 109 | You may have to copy autoHeightWebView, node_modules folders and index.js to 'demo/node_modules/react-native-autoheight-webview/', cause of installing a local package with npm will create symlink, but there is no supporting of React Native to symlink (https://github.com/facebook/watchman/issues/105). -------------------------------------------------------------------------------- /autoHeightWebView/index.js: -------------------------------------------------------------------------------- 1 | import React, {useState, useEffect, forwardRef} from 'react'; 2 | 3 | import {StyleSheet, Platform} from 'react-native'; 4 | 5 | import {ViewPropTypes} from 'deprecated-react-native-prop-types'; 6 | import PropTypes from 'prop-types'; 7 | 8 | import {WebView} from 'react-native-webview'; 9 | 10 | import { 11 | topic, 12 | reduceData, 13 | getWidth, 14 | isSizeChanged, 15 | shouldUpdate, 16 | } from './utils'; 17 | 18 | const AutoHeightWebView = React.memo( 19 | forwardRef((props, ref) => { 20 | const { 21 | style, 22 | onMessage, 23 | onSizeUpdated, 24 | scrollEnabledWithZoomedin, 25 | scrollEnabled, 26 | } = props; 27 | 28 | const [size, setSize] = useState({ 29 | height: style && style.height ? style.height : 0, 30 | width: getWidth(style), 31 | }); 32 | 33 | const [scrollable, setScrollable] = useState(false); 34 | const handleMessage = (event) => { 35 | if (event.nativeEvent) { 36 | try { 37 | const data = JSON.parse(event.nativeEvent.data); 38 | if (data.topic !== topic) { 39 | onMessage && onMessage(event); 40 | return; 41 | } 42 | const {height, width, zoomedin} = data; 43 | !scrollEnabled && 44 | scrollEnabledWithZoomedin && 45 | setScrollable(!!zoomedin); 46 | const {height: previousHeight, width: previousWidth} = size; 47 | isSizeChanged({height, previousHeight, width, previousWidth}) && 48 | setSize({ 49 | height, 50 | width, 51 | }); 52 | } catch (error) { 53 | onMessage && onMessage(event); 54 | } 55 | } else { 56 | onMessage && onMessage(event); 57 | } 58 | }; 59 | 60 | const currentScrollEnabled = 61 | scrollEnabled === false && scrollEnabledWithZoomedin 62 | ? scrollable 63 | : scrollEnabled; 64 | 65 | const {currentSource, script} = reduceData(props); 66 | 67 | const {width, height} = size; 68 | useEffect(() => { 69 | onSizeUpdated && 70 | onSizeUpdated({ 71 | height, 72 | width, 73 | }); 74 | }, [width, height, onSizeUpdated]); 75 | 76 | return React.createElement(WebView, { 77 | ...props, 78 | ref, 79 | onMessage: handleMessage, 80 | style: [ 81 | styles.webView, 82 | { 83 | width, 84 | height, 85 | }, 86 | style, 87 | ], 88 | injectedJavaScript: script, 89 | source: currentSource, 90 | scrollEnabled: currentScrollEnabled, 91 | }); 92 | }), 93 | (prevProps, nextProps) => !shouldUpdate({prevProps, nextProps}), 94 | ); 95 | 96 | AutoHeightWebView.propTypes = { 97 | onSizeUpdated: PropTypes.func, 98 | files: PropTypes.arrayOf( 99 | PropTypes.shape({ 100 | href: PropTypes.string, 101 | type: PropTypes.string, 102 | rel: PropTypes.string, 103 | }), 104 | ), 105 | style: ViewPropTypes.style, 106 | customScript: PropTypes.string, 107 | customStyle: PropTypes.string, 108 | viewportContent: PropTypes.string, 109 | scrollEnabledWithZoomedin: PropTypes.bool, 110 | // webview props 111 | originWhitelist: PropTypes.arrayOf(PropTypes.string), 112 | onMessage: PropTypes.func, 113 | scalesPageToFit: PropTypes.bool, 114 | source: PropTypes.object, 115 | }; 116 | 117 | let defaultProps = { 118 | showsVerticalScrollIndicator: false, 119 | showsHorizontalScrollIndicator: false, 120 | originWhitelist: ['*'], 121 | }; 122 | 123 | Platform.OS === 'android' && 124 | Object.assign(defaultProps, { 125 | scalesPageToFit: false, 126 | }); 127 | 128 | Platform.OS === 'ios' && 129 | Object.assign(defaultProps, { 130 | viewportContent: 'width=device-width', 131 | }); 132 | 133 | AutoHeightWebView.defaultProps = defaultProps; 134 | 135 | const styles = StyleSheet.create({ 136 | webView: { 137 | backgroundColor: 'transparent', 138 | }, 139 | }); 140 | 141 | export default AutoHeightWebView; 142 | -------------------------------------------------------------------------------- /autoHeightWebView/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import {Dimensions} from 'react-native'; 4 | 5 | export const topic = "rnaw" 6 | export const topicString = `"${topic}"` 7 | 8 | const domMutationObserveScript = ` 9 | var MutationObserver = 10 | window.MutationObserver || window.WebKitMutationObserver; 11 | var observer = new MutationObserver(updateSize); 12 | observer.observe(document, { 13 | subtree: true, 14 | attributes: true 15 | }); 16 | `; 17 | 18 | const updateSizeWithMessage = (element, scalesPageToFit) => 19 | ` 20 | var usingScale = ${scalesPageToFit} ? screen.width / window.innerWidth : 1; 21 | var scaling = false; 22 | var zoomedin = false; 23 | var lastHeight = 0; 24 | var heightTheSameTimes = 0; 25 | var maxHeightTheSameTimes = 5; 26 | var forceRefreshDelay = 1000; 27 | var forceRefreshTimeout; 28 | var checkPostMessageTimeout; 29 | 30 | function updateSize() { 31 | if (zoomedin || scaling || document.fullscreenElement) { 32 | return; 33 | } 34 | if ( 35 | !window.hasOwnProperty('ReactNativeWebView') || 36 | !window.ReactNativeWebView.hasOwnProperty('postMessage') 37 | ) { 38 | checkPostMessageTimeout = setTimeout(updateSize, 200); 39 | return; 40 | } 41 | 42 | clearTimeout(checkPostMessageTimeout); 43 | var result = ${element}.getBoundingClientRect() 44 | height = result.height + result.top; 45 | if(!height) { 46 | height = ${element}.offsetHeight || document.documentElement.offsetHeight 47 | } 48 | width = result.width; 49 | if(!width) { 50 | width = ${element}.offsetWidth || document.documentElement.offsetWidth 51 | } 52 | 53 | 54 | window.ReactNativeWebView.postMessage(JSON.stringify({ width: Math.min(width, screen.width), height: height * usingScale, topic: ${topicString} })); 55 | 56 | // Make additional height checks (required to fix issues wit twitter embeds) 57 | clearTimeout(forceRefreshTimeout); 58 | 59 | if (lastHeight !== height) { 60 | heightTheSameTimes = 1; 61 | } else { 62 | heightTheSameTimes++; 63 | } 64 | 65 | lastHeight = height; 66 | 67 | if (heightTheSameTimes <= maxHeightTheSameTimes) { 68 | forceRefreshTimeout = setTimeout( 69 | updateSize, 70 | heightTheSameTimes * forceRefreshDelay 71 | ); 72 | } 73 | } 74 | `; 75 | 76 | const setViewportContent = (content) => { 77 | if (!content) { 78 | return ''; 79 | } 80 | return ` 81 | var meta = document.createElement("meta"); 82 | meta.setAttribute("name", "viewport"); 83 | meta.setAttribute("content", "${content}"); 84 | document.getElementsByTagName("head")[0].appendChild(meta); 85 | `; 86 | }; 87 | 88 | const detectZoomChanged = ` 89 | var latestTapStamp = 0; 90 | var lastScale = 1.0; 91 | var doubleTapDelay = 400; 92 | function detectZoomChanged() { 93 | var tempZoomedin = (screen.width / window.innerWidth) > usingScale; 94 | tempZoomedin !== zoomedin && window.ReactNativeWebView.postMessage(JSON.stringify({ zoomedin: tempZoomedin, topic: ${topicString} })); 95 | zoomedin = tempZoomedin; 96 | } 97 | window.addEventListener('ontouchstart', event => { 98 | if (event.touches.length === 2) { 99 | scaling = true; 100 | } 101 | }) 102 | window.addEventListener('touchend', event => { 103 | if(scaling) { 104 | scaleing = false; 105 | } 106 | 107 | var tempScale = event.scale; 108 | tempScale !== lastScale && detectZoomChanged(); 109 | lastScale = tempScale; 110 | var timeSince = new Date().getTime() - latestTapStamp; 111 | 112 | // double tap 113 | if(timeSince < 600 && timeSince > 0) { 114 | zoomedinTimeOut = setTimeout(() => { 115 | clearTimeout(zoomedinTimeOut); 116 | detectZoomChanged(); 117 | }, doubleTapDelay); 118 | } 119 | 120 | latestTapStamp = new Date().getTime(); 121 | }); 122 | `; 123 | 124 | const getBaseScript = ({ 125 | viewportContent, 126 | scalesPageToFit, 127 | scrollEnabledWithZoomedin, 128 | }) => 129 | ` 130 | ; 131 | var wrapper = document.getElementById("rnahw-wrapper"); 132 | if (!wrapper) { 133 | wrapper = document.createElement('div'); 134 | wrapper.id = 'rnahw-wrapper'; 135 | while (document.body.firstChild instanceof Node) { 136 | wrapper.appendChild(document.body.firstChild); 137 | } 138 | document.body.appendChild(wrapper); 139 | } 140 | ${updateSizeWithMessage('wrapper', scalesPageToFit)} 141 | window.addEventListener('load', updateSize); 142 | window.addEventListener('resize', updateSize); 143 | ${domMutationObserveScript} 144 | ${setViewportContent(viewportContent)} 145 | ${scrollEnabledWithZoomedin ? detectZoomChanged : ''} 146 | updateSize(); 147 | `; 148 | 149 | const appendFilesToHead = ({files, script}) => 150 | files.reduceRight((combinedScript, file) => { 151 | const {rel, type, href} = file; 152 | return ` 153 | var link = document.createElement('link'); 154 | link.rel = '${rel}'; 155 | link.type = '${type}'; 156 | link.href = '${href}'; 157 | document.head.appendChild(link); 158 | ${combinedScript} 159 | `; 160 | }, script); 161 | 162 | const screenWidth = Dimensions.get('window').width; 163 | 164 | const bodyStyle = ` 165 | body { 166 | margin: 0; 167 | padding: 0; 168 | } 169 | `; 170 | 171 | const appendStylesToHead = ({style, script}) => { 172 | const currentStyles = style ? bodyStyle + style : bodyStyle; 173 | // Escape any single quotes or newlines in the CSS with .replace() 174 | const escaped = currentStyles.replace(/\'/g, "\\'").replace(/\n/g, '\\n'); 175 | return ` 176 | var styleElement = document.createElement('style'); 177 | styleElement.innerHTML = '${escaped}'; 178 | document.head.appendChild(styleElement); 179 | ${script} 180 | `; 181 | }; 182 | 183 | const getInjectedSource = ({html, script}) => ` 184 | ${html} 185 | 191 | `; 192 | 193 | const getScript = ({ 194 | files, 195 | customStyle, 196 | customScript, 197 | style, 198 | viewportContent, 199 | scalesPageToFit, 200 | scrollEnabledWithZoomedin, 201 | }) => { 202 | let script = getBaseScript({ 203 | viewportContent, 204 | scalesPageToFit, 205 | scrollEnabledWithZoomedin, 206 | }); 207 | script = 208 | files && files.length > 0 ? appendFilesToHead({files, script}) : script; 209 | script = appendStylesToHead({style: customStyle, script}); 210 | customScript && (script = customScript + script); 211 | return script; 212 | }; 213 | 214 | export const getWidth = (style) => { 215 | return style && style.width ? style.width : screenWidth; 216 | }; 217 | 218 | export const isSizeChanged = ({ 219 | height, 220 | previousHeight, 221 | width, 222 | previousWidth, 223 | }) => { 224 | if (!height || !width) { 225 | return; 226 | } 227 | return height !== previousHeight || width !== previousWidth; 228 | }; 229 | 230 | export const reduceData = (props) => { 231 | const {source} = props; 232 | const script = getScript(props); 233 | const {html, baseUrl} = source; 234 | if (html) { 235 | return { 236 | currentSource: {baseUrl, html: getInjectedSource({html, script})}, 237 | }; 238 | } else { 239 | return { 240 | currentSource: source, 241 | script, 242 | }; 243 | } 244 | }; 245 | 246 | export const shouldUpdate = ({prevProps, nextProps}) => { 247 | if (!(prevProps && nextProps)) { 248 | return true; 249 | } 250 | for (const prop in nextProps) { 251 | if (nextProps[prop] !== prevProps[prop]) { 252 | if ( 253 | typeof nextProps[prop] === 'object' && 254 | typeof prevProps[prop] === 'object' 255 | ) { 256 | if ( 257 | shouldUpdate({ 258 | prevProps: prevProps[prop], 259 | nextProps: nextProps[prop], 260 | }) 261 | ) { 262 | return true; 263 | } 264 | } else { 265 | return true; 266 | } 267 | } 268 | } 269 | return false; 270 | }; 271 | -------------------------------------------------------------------------------- /demo/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /demo/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /demo/.editorconfig: -------------------------------------------------------------------------------- 1 | # Windows files 2 | [*.bat] 3 | end_of_line = crlf 4 | -------------------------------------------------------------------------------- /demo/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | rules: { 5 | 'comma-dangle': 'off', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /demo/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | .*/node_modules/resolve/test/resolver/malformed_package_json/package\.json$ 15 | 16 | [untyped] 17 | .*/node_modules/@react-native-community/cli/.*/.* 18 | 19 | [include] 20 | 21 | [libs] 22 | node_modules/react-native/interface.js 23 | node_modules/react-native/flow/ 24 | 25 | [options] 26 | emoji=true 27 | 28 | exact_by_default=true 29 | 30 | format.bracket_spacing=false 31 | 32 | module.file_ext=.js 33 | module.file_ext=.json 34 | module.file_ext=.ios.js 35 | 36 | munge_underscores=true 37 | 38 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 39 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 40 | 41 | suppress_type=$FlowIssue 42 | suppress_type=$FlowFixMe 43 | suppress_type=$FlowFixMeProps 44 | suppress_type=$FlowFixMeState 45 | 46 | [lints] 47 | sketchy-null-number=warn 48 | sketchy-null-mixed=warn 49 | sketchy-number=warn 50 | untyped-type-import=warn 51 | nonstrict-import=warn 52 | deprecated-type=warn 53 | unsafe-getters-setters=warn 54 | unnecessary-invariant=warn 55 | 56 | [strict] 57 | deprecated-type 58 | nonstrict-import 59 | sketchy-null 60 | unclear-type 61 | unsafe-getters-setters 62 | untyped-import 63 | untyped-type-import 64 | 65 | [version] 66 | ^0.176.3 67 | -------------------------------------------------------------------------------- /demo/.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows files should use crlf line endings 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | ios/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | 34 | # node.js 35 | # 36 | node_modules/ 37 | npm-debug.log 38 | yarn-error.log 39 | 40 | # BUCK 41 | buck-out/ 42 | \.buckd/ 43 | *.keystore 44 | !debug.keystore 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/ 52 | 53 | **/fastlane/report.xml 54 | **/fastlane/Preview.html 55 | **/fastlane/screenshots 56 | **/fastlane/test_output 57 | 58 | # Bundle artifact 59 | *.jsbundle 60 | 61 | # Ruby / CocoaPods 62 | /ios/Pods/ 63 | /vendor/bundle/ 64 | -------------------------------------------------------------------------------- /demo/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: false, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /demo/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /demo/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/App.js: -------------------------------------------------------------------------------- 1 | import React, {useState} from 'react'; 2 | 3 | import { 4 | ScrollView, 5 | StyleSheet, 6 | Text, 7 | TouchableOpacity, 8 | Platform, 9 | Linking, 10 | } from 'react-native'; 11 | 12 | import AutoHeightWebView from 'react-native-autoheight-webview'; 13 | 14 | import { 15 | autoHeightHtml0, 16 | autoHeightHtml1, 17 | autoHeightScript, 18 | autoWidthHtml0, 19 | autoWidthHtml1, 20 | autoWidthScript, 21 | autoDetectLinkScript, 22 | style0, 23 | inlineBodyStyle, 24 | } from './config'; 25 | 26 | const onShouldStartLoadWithRequest = result => { 27 | console.log(result); 28 | return true; 29 | }; 30 | 31 | const onError = ({nativeEvent}) => 32 | console.error('WebView error: ', nativeEvent); 33 | 34 | const onMessage = event => { 35 | const {data} = event.nativeEvent; 36 | let messageData; 37 | // maybe parse stringified JSON 38 | try { 39 | messageData = JSON.parse(data); 40 | } catch (e) { 41 | console.log(e.message); 42 | } 43 | if (typeof messageData === 'object') { 44 | const {url} = messageData; 45 | // check if this message concerns us 46 | if (url && url.startsWith('http')) { 47 | Linking.openURL(url).catch(error => 48 | console.error('An error occurred', error), 49 | ); 50 | } 51 | } 52 | }; 53 | 54 | const onHeightLoadStart = () => console.log('height on load start'); 55 | 56 | const onHeightLoad = () => console.log('height on load'); 57 | 58 | const onHeightLoadEnd = () => console.log('height on load end'); 59 | 60 | const onWidthLoadStart = () => console.log('width on load start'); 61 | 62 | const onWidthLoad = () => console.log('width on load'); 63 | 64 | const onWidthLoadEnd = () => console.log('width on load end'); 65 | 66 | const Explorer = () => { 67 | const [{widthHtml, heightHtml}, setHtml] = useState({ 68 | widthHtml: autoWidthHtml0, 69 | heightHtml: autoHeightHtml0, 70 | }); 71 | const changeSource = () => 72 | setHtml({ 73 | widthHtml: widthHtml === autoWidthHtml0 ? autoWidthHtml1 : autoWidthHtml0, 74 | heightHtml: 75 | heightHtml === autoHeightHtml0 ? autoHeightHtml1 : autoHeightHtml0, 76 | }); 77 | 78 | const [{widthStyle, heightStyle}, setStyle] = useState({ 79 | heightStyle: null, 80 | widthStyle: inlineBodyStyle, 81 | }); 82 | const changeStyle = () => 83 | setStyle({ 84 | widthStyle: 85 | widthStyle === inlineBodyStyle 86 | ? style0 + inlineBodyStyle 87 | : inlineBodyStyle, 88 | heightStyle: heightStyle === null ? style0 : null, 89 | }); 90 | 91 | const [{widthScript, heightScript}, setScript] = useState({ 92 | heightScript: autoDetectLinkScript, 93 | widthScript: null, 94 | }); 95 | const changeScript = () => 96 | setScript({ 97 | widthScript: widthScript == autoWidthScript ? autoWidthScript : null, 98 | heightScript: 99 | heightScript !== autoDetectLinkScript 100 | ? autoDetectLinkScript 101 | : autoHeightScript + autoDetectLinkScript, 102 | }); 103 | 104 | const [heightSize, setHeightSize] = useState({height: 0, width: 0}); 105 | const [widthSize, setWidthSize] = useState({height: 0, width: 0}); 106 | 107 | return ( 108 | 117 | 129 | 130 | height: {heightSize.height}, width: {heightSize.width} 131 | 132 | 152 | 153 | height: {widthSize.height}, width: {widthSize.width} 154 | 155 | 156 | change source 157 | 158 | 159 | change style 160 | 161 | 164 | change script 165 | 166 | 167 | ); 168 | }; 169 | 170 | const styles = StyleSheet.create({ 171 | button: { 172 | marginTop: 15, 173 | backgroundColor: 'aliceblue', 174 | borderRadius: 5, 175 | padding: 5, 176 | }, 177 | }); 178 | 179 | export default Explorer; 180 | -------------------------------------------------------------------------------- /demo/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /demo/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /demo/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.demo", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.demo", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /demo/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and that value will be read here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | /** 124 | * Architectures to build native code for. 125 | */ 126 | def reactNativeArchitectures() { 127 | def value = project.getProperties().get("reactNativeArchitectures") 128 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 129 | } 130 | 131 | android { 132 | ndkVersion rootProject.ext.ndkVersion 133 | 134 | compileSdkVersion rootProject.ext.compileSdkVersion 135 | 136 | defaultConfig { 137 | applicationId "com.demo" 138 | minSdkVersion rootProject.ext.minSdkVersion 139 | targetSdkVersion rootProject.ext.targetSdkVersion 140 | versionCode 1 141 | versionName "1.0" 142 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 143 | 144 | if (isNewArchitectureEnabled()) { 145 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 146 | externalNativeBuild { 147 | ndkBuild { 148 | arguments "APP_PLATFORM=android-21", 149 | "APP_STL=c++_shared", 150 | "NDK_TOOLCHAIN_VERSION=clang", 151 | "GENERATED_SRC_DIR=$buildDir/generated/source", 152 | "PROJECT_BUILD_DIR=$buildDir", 153 | "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", 154 | "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", 155 | "NODE_MODULES_DIR=$rootDir/../node_modules" 156 | cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1" 157 | cppFlags "-std=c++17" 158 | // Make sure this target name is the same you specify inside the 159 | // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable. 160 | targets "demo_appmodules" 161 | } 162 | } 163 | if (!enableSeparateBuildPerCPUArchitecture) { 164 | ndk { 165 | abiFilters (*reactNativeArchitectures()) 166 | } 167 | } 168 | } 169 | } 170 | 171 | if (isNewArchitectureEnabled()) { 172 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 173 | externalNativeBuild { 174 | ndkBuild { 175 | path "$projectDir/src/main/jni/Android.mk" 176 | } 177 | } 178 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 179 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 180 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 181 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 182 | into("$buildDir/react-ndk/exported") 183 | } 184 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 185 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 186 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 187 | into("$buildDir/react-ndk/exported") 188 | } 189 | afterEvaluate { 190 | // If you wish to add a custom TurboModule or component locally, 191 | // you should uncomment this line. 192 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 193 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 194 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 195 | 196 | // Due to a bug inside AGP, we have to explicitly set a dependency 197 | // between configureNdkBuild* tasks and the preBuild tasks. 198 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 199 | configureNdkBuildRelease.dependsOn(preReleaseBuild) 200 | configureNdkBuildDebug.dependsOn(preDebugBuild) 201 | reactNativeArchitectures().each { architecture -> 202 | tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure { 203 | dependsOn("preDebugBuild") 204 | } 205 | tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure { 206 | dependsOn("preReleaseBuild") 207 | } 208 | } 209 | } 210 | } 211 | 212 | splits { 213 | abi { 214 | reset() 215 | enable enableSeparateBuildPerCPUArchitecture 216 | universalApk false // If true, also generate a universal APK 217 | include (*reactNativeArchitectures()) 218 | } 219 | } 220 | signingConfigs { 221 | debug { 222 | storeFile file('debug.keystore') 223 | storePassword 'android' 224 | keyAlias 'androiddebugkey' 225 | keyPassword 'android' 226 | } 227 | } 228 | buildTypes { 229 | debug { 230 | signingConfig signingConfigs.debug 231 | } 232 | release { 233 | // Caution! In production, you need to generate your own keystore file. 234 | // see https://reactnative.dev/docs/signed-apk-android. 235 | signingConfig signingConfigs.debug 236 | minifyEnabled enableProguardInReleaseBuilds 237 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 238 | } 239 | } 240 | 241 | // applicationVariants are e.g. debug, release 242 | applicationVariants.all { variant -> 243 | variant.outputs.each { output -> 244 | // For each separate APK per architecture, set a unique version code as described here: 245 | // https://developer.android.com/studio/build/configure-apk-splits.html 246 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 247 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 248 | def abi = output.getFilter(OutputFile.ABI) 249 | if (abi != null) { // null for the universal-debug, universal-release variants 250 | output.versionCodeOverride = 251 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 252 | } 253 | 254 | } 255 | } 256 | } 257 | 258 | dependencies { 259 | implementation fileTree(dir: "libs", include: ["*.jar"]) 260 | 261 | //noinspection GradleDynamicVersion 262 | implementation "com.facebook.react:react-native:+" // From node_modules 263 | 264 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 265 | 266 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 267 | exclude group:'com.facebook.fbjni' 268 | } 269 | 270 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 271 | exclude group:'com.facebook.flipper' 272 | exclude group:'com.squareup.okhttp3', module:'okhttp' 273 | } 274 | 275 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 276 | exclude group:'com.facebook.flipper' 277 | } 278 | 279 | if (enableHermes) { 280 | //noinspection GradleDynamicVersion 281 | implementation("com.facebook.react:hermes-engine:+") { // From node_modules 282 | exclude group:'com.facebook.fbjni' 283 | } 284 | } else { 285 | implementation jscFlavor 286 | } 287 | } 288 | 289 | if (isNewArchitectureEnabled()) { 290 | // If new architecture is enabled, we let you build RN from source 291 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 292 | // This will be applied to all the imported transtitive dependency. 293 | configurations.all { 294 | resolutionStrategy.dependencySubstitution { 295 | substitute(module("com.facebook.react:react-native")) 296 | .using(project(":ReactAndroid")) 297 | .because("On New Architecture we're building React Native from source") 298 | substitute(module("com.facebook.react:hermes-engine")) 299 | .using(project(":ReactAndroid:hermes-engine")) 300 | .because("On New Architecture we're building Hermes from source") 301 | } 302 | } 303 | } 304 | 305 | // Run this once to be able to run the application with BUCK 306 | // puts all compile dependencies into folder libs for BUCK to use 307 | task copyDownloadableDepsToLibs(type: Copy) { 308 | from configurations.implementation 309 | into 'libs' 310 | } 311 | 312 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 313 | 314 | def isNewArchitectureEnabled() { 315 | // To opt-in for the New Architecture, you can either: 316 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 317 | // - Invoke gradle with `-newArchEnabled=true` 318 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 319 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 320 | } 321 | -------------------------------------------------------------------------------- /demo/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /demo/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/debug.keystore -------------------------------------------------------------------------------- /demo/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /demo/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/android/app/src/debug/java/com/demo/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.demo; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceEventListener; 23 | import com.facebook.react.ReactInstanceManager; 24 | import com.facebook.react.bridge.ReactContext; 25 | import com.facebook.react.modules.network.NetworkingModule; 26 | import okhttp3.OkHttpClient; 27 | 28 | public class ReactNativeFlipper { 29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 30 | if (FlipperUtils.shouldEnableFlipper(context)) { 31 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 32 | 33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 34 | client.addPlugin(new ReactFlipperPlugin()); 35 | client.addPlugin(new DatabasesFlipperPlugin(context)); 36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 37 | client.addPlugin(CrashReporterPlugin.getInstance()); 38 | 39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 40 | NetworkingModule.setCustomClientBuilder( 41 | new NetworkingModule.CustomClientBuilder() { 42 | @Override 43 | public void apply(OkHttpClient.Builder builder) { 44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 45 | } 46 | }); 47 | client.addPlugin(networkFlipperPlugin); 48 | client.start(); 49 | 50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 51 | // Hence we run if after all native modules have been initialized 52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 53 | if (reactContext == null) { 54 | reactInstanceManager.addReactInstanceEventListener( 55 | new ReactInstanceEventListener() { 56 | @Override 57 | public void onReactContextInitialized(ReactContext reactContext) { 58 | reactInstanceManager.removeReactInstanceEventListener(this); 59 | reactContext.runOnNativeModulesQueueThread( 60 | new Runnable() { 61 | @Override 62 | public void run() { 63 | client.addPlugin(new FrescoFlipperPlugin()); 64 | } 65 | }); 66 | } 67 | }); 68 | } else { 69 | client.addPlugin(new FrescoFlipperPlugin()); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /demo/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /demo/android/app/src/main/java/com/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.demo; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | 7 | public class MainActivity extends ReactActivity { 8 | 9 | /** 10 | * Returns the name of the main component registered from JavaScript. This is used to schedule 11 | * rendering of the component. 12 | */ 13 | @Override 14 | protected String getMainComponentName() { 15 | return "demo"; 16 | } 17 | 18 | /** 19 | * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and 20 | * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer 21 | * (Paper). 22 | */ 23 | @Override 24 | protected ReactActivityDelegate createReactActivityDelegate() { 25 | return new MainActivityDelegate(this, getMainComponentName()); 26 | } 27 | 28 | public static class MainActivityDelegate extends ReactActivityDelegate { 29 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 30 | super(activity, mainComponentName); 31 | } 32 | 33 | @Override 34 | protected ReactRootView createRootView() { 35 | ReactRootView reactRootView = new ReactRootView(getContext()); 36 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 37 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 38 | return reactRootView; 39 | } 40 | 41 | @Override 42 | protected boolean isConcurrentRootEnabled() { 43 | // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). 44 | // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html 45 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo/android/app/src/main/java/com/demo/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.demo; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.config.ReactFeatureFlags; 11 | import com.facebook.soloader.SoLoader; 12 | import com.demo.newarchitecture.MainApplicationReactNativeHost; 13 | import java.lang.reflect.InvocationTargetException; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for example: 30 | // packages.add(new MyReactNativePackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | private final ReactNativeHost mNewArchitectureNativeHost = 41 | new MainApplicationReactNativeHost(this); 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 46 | return mNewArchitectureNativeHost; 47 | } else { 48 | return mReactNativeHost; 49 | } 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | // If you opted-in for the New Architecture, we enable the TurboModule system 56 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 57 | SoLoader.init(this, /* native exopackage */ false); 58 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 59 | } 60 | 61 | /** 62 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 63 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 64 | * 65 | * @param context 66 | * @param reactInstanceManager 67 | */ 68 | private static void initializeFlipper( 69 | Context context, ReactInstanceManager reactInstanceManager) { 70 | if (BuildConfig.DEBUG) { 71 | try { 72 | /* 73 | We use reflection here to pick up the class that initializes Flipper, 74 | since Flipper library is not available in release mode 75 | */ 76 | Class aClass = Class.forName("com.demo.ReactNativeFlipper"); 77 | aClass 78 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 79 | .invoke(null, context, reactInstanceManager); 80 | } catch (ClassNotFoundException e) { 81 | e.printStackTrace(); 82 | } catch (NoSuchMethodException e) { 83 | e.printStackTrace(); 84 | } catch (IllegalAccessException e) { 85 | e.printStackTrace(); 86 | } catch (InvocationTargetException e) { 87 | e.printStackTrace(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /demo/android/app/src/main/java/com/demo/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.demo.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.FabricJSIModuleProvider; 20 | import com.facebook.react.fabric.ReactNativeConfig; 21 | import com.facebook.react.uimanager.ViewManagerRegistry; 22 | import com.demo.BuildConfig; 23 | import com.demo.newarchitecture.components.MainComponentsRegistry; 24 | import com.demo.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 30 | * TurboModule delegates and the Fabric Renderer. 31 | * 32 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 33 | * `newArchEnabled` property). Is ignored otherwise. 34 | */ 35 | public class MainApplicationReactNativeHost extends ReactNativeHost { 36 | public MainApplicationReactNativeHost(Application application) { 37 | super(application); 38 | } 39 | 40 | @Override 41 | public boolean getUseDeveloperSupport() { 42 | return BuildConfig.DEBUG; 43 | } 44 | 45 | @Override 46 | protected List getPackages() { 47 | List packages = new PackageList(this).getPackages(); 48 | // Packages that cannot be autolinked yet can be added manually here, for example: 49 | // packages.add(new MyReactNativePackage()); 50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 51 | // packages.add(new TurboReactPackage() { ... }); 52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 53 | // inside a ReactPackage. 54 | return packages; 55 | } 56 | 57 | @Override 58 | protected String getJSMainModuleName() { 59 | return "index"; 60 | } 61 | 62 | @NonNull 63 | @Override 64 | protected ReactPackageTurboModuleManagerDelegate.Builder 65 | getReactPackageTurboModuleManagerDelegateBuilder() { 66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 67 | // for the new architecture and to use TurboModules correctly. 68 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 69 | } 70 | 71 | @Override 72 | protected JSIModulePackage getJSIModulePackage() { 73 | return new JSIModulePackage() { 74 | @Override 75 | public List getJSIModules( 76 | final ReactApplicationContext reactApplicationContext, 77 | final JavaScriptContextHolder jsContext) { 78 | final List specs = new ArrayList<>(); 79 | 80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 81 | // custom Fabric Components. 82 | specs.add( 83 | new JSIModuleSpec() { 84 | @Override 85 | public JSIModuleType getJSIModuleType() { 86 | return JSIModuleType.UIManager; 87 | } 88 | 89 | @Override 90 | public JSIModuleProvider getJSIModuleProvider() { 91 | final ComponentFactory componentFactory = new ComponentFactory(); 92 | CoreComponentsRegistry.register(componentFactory); 93 | 94 | // Here we register a Components Registry. 95 | // The one that is generated with the template contains no components 96 | // and just provides you the one from React Native core. 97 | MainComponentsRegistry.register(componentFactory); 98 | 99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 100 | 101 | ViewManagerRegistry viewManagerRegistry = 102 | new ViewManagerRegistry( 103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 104 | 105 | return new FabricJSIModuleProvider( 106 | reactApplicationContext, 107 | componentFactory, 108 | ReactNativeConfig.DEFAULT_CONFIG, 109 | viewManagerRegistry); 110 | } 111 | }); 112 | return specs; 113 | } 114 | }; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /demo/android/app/src/main/java/com/demo/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.demo.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /demo/android/app/src/main/java/com/demo/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.demo.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("demo_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | THIS_DIR := $(call my-dir) 2 | 3 | include $(REACT_ANDROID_DIR)/Android-prebuilt.mk 4 | 5 | # If you wish to add a custom TurboModule or Fabric component in your app you 6 | # will have to include the following autogenerated makefile. 7 | # include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk 8 | include $(CLEAR_VARS) 9 | 10 | LOCAL_PATH := $(THIS_DIR) 11 | 12 | # You can customize the name of your application .so file here. 13 | LOCAL_MODULE := demo_appmodules 14 | 15 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 16 | LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) 17 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 18 | 19 | # If you wish to add a custom TurboModule or Fabric component in your app you 20 | # will have to uncomment those lines to include the generated source 21 | # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) 22 | # 23 | # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 24 | # LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) 25 | # LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni 26 | 27 | # Here you should add any native library you wish to depend on. 28 | LOCAL_SHARED_LIBRARIES := \ 29 | libfabricjni \ 30 | libfbjni \ 31 | libfolly_runtime \ 32 | libglog \ 33 | libjsi \ 34 | libreact_codegen_rncore \ 35 | libreact_debug \ 36 | libreact_nativemodule_core \ 37 | libreact_render_componentregistry \ 38 | libreact_render_core \ 39 | libreact_render_debug \ 40 | libreact_render_graphics \ 41 | librrc_view \ 42 | libruntimeexecutor \ 43 | libturbomodulejsijni \ 44 | libyoga 45 | 46 | LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall 47 | 48 | include $(BUILD_SHARED_LIBRARY) 49 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | 5 | namespace facebook { 6 | namespace react { 7 | 8 | std::shared_ptr MainApplicationModuleProvider( 9 | const std::string moduleName, 10 | const JavaTurboModule::InitParams ¶ms) { 11 | // Here you can provide your own module provider for TurboModules coming from 12 | // either your application or from external libraries. The approach to follow 13 | // is similar to the following (for a library called `samplelibrary`: 14 | // 15 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 16 | // if (module != nullptr) { 17 | // return module; 18 | // } 19 | // return rncore_ModuleProvider(moduleName, params); 20 | return rncore_ModuleProvider(moduleName, params); 21 | } 22 | 23 | } // namespace react 24 | } // namespace facebook 25 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string name, 26 | const std::shared_ptr jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | std::string name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/demo/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string name, 25 | const std::shared_ptr jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(std::string name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 12 | 13 | std::shared_ptr 14 | MainComponentsRegistry::sharedProviderRegistry() { 15 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 16 | 17 | // Custom Fabric Components go here. You can register custom 18 | // components coming from your App or from 3rd party libraries here. 19 | // 20 | // providerRegistry->add(concreteComponentDescriptorProvider< 21 | // AocViewerComponentDescriptor>()); 22 | return providerRegistry; 23 | } 24 | 25 | jni::local_ref 26 | MainComponentsRegistry::initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate) { 29 | auto instance = makeCxxInstance(delegate); 30 | 31 | auto buildRegistryFunction = 32 | [](EventDispatcher::Weak const &eventDispatcher, 33 | ContextContainer::Shared const &contextContainer) 34 | -> ComponentDescriptorRegistry::Shared { 35 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 36 | ->createComponentDescriptorRegistry( 37 | {eventDispatcher, contextContainer}); 38 | 39 | auto mutableRegistry = 40 | std::const_pointer_cast(registry); 41 | 42 | mutableRegistry->setFallbackComponentDescriptor( 43 | std::make_shared( 44 | ComponentDescriptorParameters{ 45 | eventDispatcher, contextContainer, nullptr})); 46 | 47 | return registry; 48 | }; 49 | 50 | delegate->buildRegistryFunction = buildRegistryFunction; 51 | return instance; 52 | } 53 | 54 | void MainComponentsRegistry::registerNatives() { 55 | registerHybrid({ 56 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 57 | }); 58 | } 59 | 60 | } // namespace react 61 | } // namespace facebook 62 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/demo/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /demo/android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | demo 3 | 4 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /demo/android/build.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 4 | 5 | buildscript { 6 | ext { 7 | buildToolsVersion = "31.0.0" 8 | kotlinVersion = "1.6.0" 9 | minSdkVersion = 21 10 | compileSdkVersion = 31 11 | targetSdkVersion = 31 12 | 13 | if (System.properties['os.arch'] == "aarch64") { 14 | // For M1 Users we need to use the NDK 24 which added support for aarch64 15 | ndkVersion = "24.0.8215888" 16 | } else { 17 | // Otherwise we default to the side-by-side NDK version from AGP. 18 | ndkVersion = "21.4.7075529" 19 | } 20 | } 21 | repositories { 22 | google() 23 | mavenCentral() 24 | } 25 | dependencies { 26 | classpath("com.android.tools.build:gradle:7.1.1") 27 | classpath("com.facebook.react:react-native-gradle-plugin") 28 | classpath("de.undercouch:gradle-download-task:5.0.1") 29 | // NOTE: Do not place your application dependencies here; they belong 30 | // in the individual module build.gradle files 31 | } 32 | } 33 | 34 | allprojects { 35 | repositories { 36 | maven { 37 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 38 | url("$rootDir/../node_modules/react-native/android") 39 | } 40 | maven { 41 | // Android JSC is installed from npm 42 | url("$rootDir/../node_modules/jsc-android/dist") 43 | } 44 | mavenCentral { 45 | // We don't want to fetch react-native from Maven Central as there are 46 | // older versions over there. 47 | content { 48 | excludeGroup "com.facebook.react" 49 | } 50 | } 51 | google() 52 | maven { url 'https://www.jitpack.io' } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /demo/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.125.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | -------------------------------------------------------------------------------- /demo/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iou90/react-native-autoheight-webview/ef4c7b161d121f7796a744d9df8a1b9c9a77ed36/demo/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /demo/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /demo/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (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 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /demo/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://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 Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /demo/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'demo' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | include(":ReactAndroid:hermes-engine") 10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') 11 | } 12 | -------------------------------------------------------------------------------- /demo/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "displayName": "demo" 4 | } -------------------------------------------------------------------------------- /demo/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /demo/config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const autoHeightHtml0 = `

Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn't only tag the piece with "moving". I’d also use the tags "pets", "marriage", "career change", and "travel tips".

`; 4 | 5 | const autoHeightHtml1 = `Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with "moving".`; 6 | 7 | const style0 = ` 8 | p { 9 | font-family: sans-serif; 10 | padding: 50px; 11 | box-sizing: border-box; 12 | } 13 | `; 14 | 15 | const style1 = ` 16 | p { 17 | font-size: 12px !important; 18 | box-sizing: border-box; 19 | } 20 | `; 21 | 22 | const inlineBodyStyle = ` 23 | body { 24 | display: inline-block; 25 | } 26 | `; 27 | 28 | // https://medium.com/@elhardoum/opening-external-links-in-browser-in-react-native-webview-18fe6a66312a 29 | const autoDetectLinkScript = ` 30 | (function() { 31 | var links = document.querySelectorAll('a[href]'); 32 | if (links) { 33 | for (var index = 0; index < links.length; index++) { 34 | links[index].addEventListener('click', function(event) { 35 | event.preventDefault(); 36 | window.ReactNativeWebView.postMessage(JSON.stringify({ url: this.href })); 37 | }); 38 | } 39 | } 40 | })(); 41 | `; 42 | 43 | const autoHeightScript = ` 44 | var styleElement = document.createElement('style'); 45 | styleElement.innerHTML = '${style1.replace(/\'/g, "\\'").replace(/\n/g, '\\n')}'; 46 | document.head.appendChild(styleElement); 47 | document.body.style.background = 'cornflowerblue'; 48 | `; 49 | 50 | const autoWidthHtml0 = ` 51 | 52 | 53 | 54 | 55 |

hey

56 | 57 | `; 58 | 59 | const autoWidthHtml1 = ` 60 |

easy

61 | `; 62 | 63 | const autoWidthScript = ` 64 | var styleElement = document.createElement('style'); 65 | styleElement.innerHTML = '${style1.replace(/\'/g, "\\'").replace(/\n/g, '\\n')}'; 66 | document.head.appendChild(styleElement); 67 | `; 68 | 69 | export { 70 | autoHeightHtml0, 71 | autoHeightHtml1, 72 | style0, 73 | autoHeightScript, 74 | autoWidthHtml0, 75 | autoWidthHtml1, 76 | autoWidthScript, 77 | inlineBodyStyle, 78 | autoDetectLinkScript 79 | }; -------------------------------------------------------------------------------- /demo/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /demo/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /demo/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '12.4' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'demo' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | use_react_native!( 14 | :path => config[:reactNativePath], 15 | # to enable hermes on iOS, change `false` to `true` and then install pods 16 | :hermes_enabled => flags[:hermes_enabled], 17 | :fabric_enabled => flags[:fabric_enabled], 18 | # An absolute path to your application root. 19 | :app_path => "#{Pod::Config.instance.installation_root}/.." 20 | ) 21 | 22 | target 'demoTests' do 23 | inherit! :complete 24 | # Pods for testing 25 | end 26 | 27 | # Enables Flipper. 28 | # 29 | # Note that if you have use_frameworks! enabled, Flipper will not work and 30 | # you should disable the next line. 31 | use_flipper!() 32 | 33 | post_install do |installer| 34 | react_native_post_install(installer) 35 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /demo/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.69.1) 6 | - FBReactNativeSpec (0.69.1): 7 | - RCT-Folly (= 2021.06.28.00-v2) 8 | - RCTRequired (= 0.69.1) 9 | - RCTTypeSafety (= 0.69.1) 10 | - React-Core (= 0.69.1) 11 | - React-jsi (= 0.69.1) 12 | - ReactCommon/turbomodule/core (= 0.69.1) 13 | - Flipper (0.125.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.2.0.1) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.10): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.1100) 26 | - Flipper-Glog (0.5.0.5) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.125.0): 31 | - FlipperKit/Core (= 0.125.0) 32 | - FlipperKit/Core (0.125.0): 33 | - Flipper (~> 0.125.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - SocketRocket (~> 0.6.0) 39 | - FlipperKit/CppBridge (0.125.0): 40 | - Flipper (~> 0.125.0) 41 | - FlipperKit/FBCxxFollyDynamicConvert (0.125.0): 42 | - Flipper-Folly (~> 2.6) 43 | - FlipperKit/FBDefines (0.125.0) 44 | - FlipperKit/FKPortForwarding (0.125.0): 45 | - CocoaAsyncSocket (~> 7.6) 46 | - Flipper-PeerTalk (~> 0.0.4) 47 | - FlipperKit/FlipperKitHighlightOverlay (0.125.0) 48 | - FlipperKit/FlipperKitLayoutHelpers (0.125.0): 49 | - FlipperKit/Core 50 | - FlipperKit/FlipperKitHighlightOverlay 51 | - FlipperKit/FlipperKitLayoutTextSearchable 52 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0): 53 | - FlipperKit/Core 54 | - FlipperKit/FlipperKitHighlightOverlay 55 | - FlipperKit/FlipperKitLayoutHelpers 56 | - YogaKit (~> 1.18) 57 | - FlipperKit/FlipperKitLayoutPlugin (0.125.0): 58 | - FlipperKit/Core 59 | - FlipperKit/FlipperKitHighlightOverlay 60 | - FlipperKit/FlipperKitLayoutHelpers 61 | - FlipperKit/FlipperKitLayoutIOSDescriptors 62 | - FlipperKit/FlipperKitLayoutTextSearchable 63 | - YogaKit (~> 1.18) 64 | - FlipperKit/FlipperKitLayoutTextSearchable (0.125.0) 65 | - FlipperKit/FlipperKitNetworkPlugin (0.125.0): 66 | - FlipperKit/Core 67 | - FlipperKit/FlipperKitReactPlugin (0.125.0): 68 | - FlipperKit/Core 69 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0): 70 | - FlipperKit/Core 71 | - FlipperKit/SKIOSNetworkPlugin (0.125.0): 72 | - FlipperKit/Core 73 | - FlipperKit/FlipperKitNetworkPlugin 74 | - fmt (6.2.1) 75 | - glog (0.3.5) 76 | - libevent (2.1.12) 77 | - OpenSSL-Universal (1.1.1100) 78 | - RCT-Folly (2021.06.28.00-v2): 79 | - boost 80 | - DoubleConversion 81 | - fmt (~> 6.2.1) 82 | - glog 83 | - RCT-Folly/Default (= 2021.06.28.00-v2) 84 | - RCT-Folly/Default (2021.06.28.00-v2): 85 | - boost 86 | - DoubleConversion 87 | - fmt (~> 6.2.1) 88 | - glog 89 | - RCTRequired (0.69.1) 90 | - RCTTypeSafety (0.69.1): 91 | - FBLazyVector (= 0.69.1) 92 | - RCTRequired (= 0.69.1) 93 | - React-Core (= 0.69.1) 94 | - React (0.69.1): 95 | - React-Core (= 0.69.1) 96 | - React-Core/DevSupport (= 0.69.1) 97 | - React-Core/RCTWebSocket (= 0.69.1) 98 | - React-RCTActionSheet (= 0.69.1) 99 | - React-RCTAnimation (= 0.69.1) 100 | - React-RCTBlob (= 0.69.1) 101 | - React-RCTImage (= 0.69.1) 102 | - React-RCTLinking (= 0.69.1) 103 | - React-RCTNetwork (= 0.69.1) 104 | - React-RCTSettings (= 0.69.1) 105 | - React-RCTText (= 0.69.1) 106 | - React-RCTVibration (= 0.69.1) 107 | - React-bridging (0.69.1): 108 | - RCT-Folly (= 2021.06.28.00-v2) 109 | - React-jsi (= 0.69.1) 110 | - React-callinvoker (0.69.1) 111 | - React-Codegen (0.69.1): 112 | - FBReactNativeSpec (= 0.69.1) 113 | - RCT-Folly (= 2021.06.28.00-v2) 114 | - RCTRequired (= 0.69.1) 115 | - RCTTypeSafety (= 0.69.1) 116 | - React-Core (= 0.69.1) 117 | - React-jsi (= 0.69.1) 118 | - React-jsiexecutor (= 0.69.1) 119 | - ReactCommon/turbomodule/core (= 0.69.1) 120 | - React-Core (0.69.1): 121 | - glog 122 | - RCT-Folly (= 2021.06.28.00-v2) 123 | - React-Core/Default (= 0.69.1) 124 | - React-cxxreact (= 0.69.1) 125 | - React-jsi (= 0.69.1) 126 | - React-jsiexecutor (= 0.69.1) 127 | - React-perflogger (= 0.69.1) 128 | - Yoga 129 | - React-Core/CoreModulesHeaders (0.69.1): 130 | - glog 131 | - RCT-Folly (= 2021.06.28.00-v2) 132 | - React-Core/Default 133 | - React-cxxreact (= 0.69.1) 134 | - React-jsi (= 0.69.1) 135 | - React-jsiexecutor (= 0.69.1) 136 | - React-perflogger (= 0.69.1) 137 | - Yoga 138 | - React-Core/Default (0.69.1): 139 | - glog 140 | - RCT-Folly (= 2021.06.28.00-v2) 141 | - React-cxxreact (= 0.69.1) 142 | - React-jsi (= 0.69.1) 143 | - React-jsiexecutor (= 0.69.1) 144 | - React-perflogger (= 0.69.1) 145 | - Yoga 146 | - React-Core/DevSupport (0.69.1): 147 | - glog 148 | - RCT-Folly (= 2021.06.28.00-v2) 149 | - React-Core/Default (= 0.69.1) 150 | - React-Core/RCTWebSocket (= 0.69.1) 151 | - React-cxxreact (= 0.69.1) 152 | - React-jsi (= 0.69.1) 153 | - React-jsiexecutor (= 0.69.1) 154 | - React-jsinspector (= 0.69.1) 155 | - React-perflogger (= 0.69.1) 156 | - Yoga 157 | - React-Core/RCTActionSheetHeaders (0.69.1): 158 | - glog 159 | - RCT-Folly (= 2021.06.28.00-v2) 160 | - React-Core/Default 161 | - React-cxxreact (= 0.69.1) 162 | - React-jsi (= 0.69.1) 163 | - React-jsiexecutor (= 0.69.1) 164 | - React-perflogger (= 0.69.1) 165 | - Yoga 166 | - React-Core/RCTAnimationHeaders (0.69.1): 167 | - glog 168 | - RCT-Folly (= 2021.06.28.00-v2) 169 | - React-Core/Default 170 | - React-cxxreact (= 0.69.1) 171 | - React-jsi (= 0.69.1) 172 | - React-jsiexecutor (= 0.69.1) 173 | - React-perflogger (= 0.69.1) 174 | - Yoga 175 | - React-Core/RCTBlobHeaders (0.69.1): 176 | - glog 177 | - RCT-Folly (= 2021.06.28.00-v2) 178 | - React-Core/Default 179 | - React-cxxreact (= 0.69.1) 180 | - React-jsi (= 0.69.1) 181 | - React-jsiexecutor (= 0.69.1) 182 | - React-perflogger (= 0.69.1) 183 | - Yoga 184 | - React-Core/RCTImageHeaders (0.69.1): 185 | - glog 186 | - RCT-Folly (= 2021.06.28.00-v2) 187 | - React-Core/Default 188 | - React-cxxreact (= 0.69.1) 189 | - React-jsi (= 0.69.1) 190 | - React-jsiexecutor (= 0.69.1) 191 | - React-perflogger (= 0.69.1) 192 | - Yoga 193 | - React-Core/RCTLinkingHeaders (0.69.1): 194 | - glog 195 | - RCT-Folly (= 2021.06.28.00-v2) 196 | - React-Core/Default 197 | - React-cxxreact (= 0.69.1) 198 | - React-jsi (= 0.69.1) 199 | - React-jsiexecutor (= 0.69.1) 200 | - React-perflogger (= 0.69.1) 201 | - Yoga 202 | - React-Core/RCTNetworkHeaders (0.69.1): 203 | - glog 204 | - RCT-Folly (= 2021.06.28.00-v2) 205 | - React-Core/Default 206 | - React-cxxreact (= 0.69.1) 207 | - React-jsi (= 0.69.1) 208 | - React-jsiexecutor (= 0.69.1) 209 | - React-perflogger (= 0.69.1) 210 | - Yoga 211 | - React-Core/RCTSettingsHeaders (0.69.1): 212 | - glog 213 | - RCT-Folly (= 2021.06.28.00-v2) 214 | - React-Core/Default 215 | - React-cxxreact (= 0.69.1) 216 | - React-jsi (= 0.69.1) 217 | - React-jsiexecutor (= 0.69.1) 218 | - React-perflogger (= 0.69.1) 219 | - Yoga 220 | - React-Core/RCTTextHeaders (0.69.1): 221 | - glog 222 | - RCT-Folly (= 2021.06.28.00-v2) 223 | - React-Core/Default 224 | - React-cxxreact (= 0.69.1) 225 | - React-jsi (= 0.69.1) 226 | - React-jsiexecutor (= 0.69.1) 227 | - React-perflogger (= 0.69.1) 228 | - Yoga 229 | - React-Core/RCTVibrationHeaders (0.69.1): 230 | - glog 231 | - RCT-Folly (= 2021.06.28.00-v2) 232 | - React-Core/Default 233 | - React-cxxreact (= 0.69.1) 234 | - React-jsi (= 0.69.1) 235 | - React-jsiexecutor (= 0.69.1) 236 | - React-perflogger (= 0.69.1) 237 | - Yoga 238 | - React-Core/RCTWebSocket (0.69.1): 239 | - glog 240 | - RCT-Folly (= 2021.06.28.00-v2) 241 | - React-Core/Default (= 0.69.1) 242 | - React-cxxreact (= 0.69.1) 243 | - React-jsi (= 0.69.1) 244 | - React-jsiexecutor (= 0.69.1) 245 | - React-perflogger (= 0.69.1) 246 | - Yoga 247 | - React-CoreModules (0.69.1): 248 | - RCT-Folly (= 2021.06.28.00-v2) 249 | - RCTTypeSafety (= 0.69.1) 250 | - React-Codegen (= 0.69.1) 251 | - React-Core/CoreModulesHeaders (= 0.69.1) 252 | - React-jsi (= 0.69.1) 253 | - React-RCTImage (= 0.69.1) 254 | - ReactCommon/turbomodule/core (= 0.69.1) 255 | - React-cxxreact (0.69.1): 256 | - boost (= 1.76.0) 257 | - DoubleConversion 258 | - glog 259 | - RCT-Folly (= 2021.06.28.00-v2) 260 | - React-callinvoker (= 0.69.1) 261 | - React-jsi (= 0.69.1) 262 | - React-jsinspector (= 0.69.1) 263 | - React-logger (= 0.69.1) 264 | - React-perflogger (= 0.69.1) 265 | - React-runtimeexecutor (= 0.69.1) 266 | - React-jsi (0.69.1): 267 | - boost (= 1.76.0) 268 | - DoubleConversion 269 | - glog 270 | - RCT-Folly (= 2021.06.28.00-v2) 271 | - React-jsi/Default (= 0.69.1) 272 | - React-jsi/Default (0.69.1): 273 | - boost (= 1.76.0) 274 | - DoubleConversion 275 | - glog 276 | - RCT-Folly (= 2021.06.28.00-v2) 277 | - React-jsiexecutor (0.69.1): 278 | - DoubleConversion 279 | - glog 280 | - RCT-Folly (= 2021.06.28.00-v2) 281 | - React-cxxreact (= 0.69.1) 282 | - React-jsi (= 0.69.1) 283 | - React-perflogger (= 0.69.1) 284 | - React-jsinspector (0.69.1) 285 | - React-logger (0.69.1): 286 | - glog 287 | - react-native-webview (11.22.7): 288 | - React-Core 289 | - React-perflogger (0.69.1) 290 | - React-RCTActionSheet (0.69.1): 291 | - React-Core/RCTActionSheetHeaders (= 0.69.1) 292 | - React-RCTAnimation (0.69.1): 293 | - RCT-Folly (= 2021.06.28.00-v2) 294 | - RCTTypeSafety (= 0.69.1) 295 | - React-Codegen (= 0.69.1) 296 | - React-Core/RCTAnimationHeaders (= 0.69.1) 297 | - React-jsi (= 0.69.1) 298 | - ReactCommon/turbomodule/core (= 0.69.1) 299 | - React-RCTBlob (0.69.1): 300 | - RCT-Folly (= 2021.06.28.00-v2) 301 | - React-Codegen (= 0.69.1) 302 | - React-Core/RCTBlobHeaders (= 0.69.1) 303 | - React-Core/RCTWebSocket (= 0.69.1) 304 | - React-jsi (= 0.69.1) 305 | - React-RCTNetwork (= 0.69.1) 306 | - ReactCommon/turbomodule/core (= 0.69.1) 307 | - React-RCTImage (0.69.1): 308 | - RCT-Folly (= 2021.06.28.00-v2) 309 | - RCTTypeSafety (= 0.69.1) 310 | - React-Codegen (= 0.69.1) 311 | - React-Core/RCTImageHeaders (= 0.69.1) 312 | - React-jsi (= 0.69.1) 313 | - React-RCTNetwork (= 0.69.1) 314 | - ReactCommon/turbomodule/core (= 0.69.1) 315 | - React-RCTLinking (0.69.1): 316 | - React-Codegen (= 0.69.1) 317 | - React-Core/RCTLinkingHeaders (= 0.69.1) 318 | - React-jsi (= 0.69.1) 319 | - ReactCommon/turbomodule/core (= 0.69.1) 320 | - React-RCTNetwork (0.69.1): 321 | - RCT-Folly (= 2021.06.28.00-v2) 322 | - RCTTypeSafety (= 0.69.1) 323 | - React-Codegen (= 0.69.1) 324 | - React-Core/RCTNetworkHeaders (= 0.69.1) 325 | - React-jsi (= 0.69.1) 326 | - ReactCommon/turbomodule/core (= 0.69.1) 327 | - React-RCTSettings (0.69.1): 328 | - RCT-Folly (= 2021.06.28.00-v2) 329 | - RCTTypeSafety (= 0.69.1) 330 | - React-Codegen (= 0.69.1) 331 | - React-Core/RCTSettingsHeaders (= 0.69.1) 332 | - React-jsi (= 0.69.1) 333 | - ReactCommon/turbomodule/core (= 0.69.1) 334 | - React-RCTText (0.69.1): 335 | - React-Core/RCTTextHeaders (= 0.69.1) 336 | - React-RCTVibration (0.69.1): 337 | - RCT-Folly (= 2021.06.28.00-v2) 338 | - React-Codegen (= 0.69.1) 339 | - React-Core/RCTVibrationHeaders (= 0.69.1) 340 | - React-jsi (= 0.69.1) 341 | - ReactCommon/turbomodule/core (= 0.69.1) 342 | - React-runtimeexecutor (0.69.1): 343 | - React-jsi (= 0.69.1) 344 | - ReactCommon/turbomodule/core (0.69.1): 345 | - DoubleConversion 346 | - glog 347 | - RCT-Folly (= 2021.06.28.00-v2) 348 | - React-bridging (= 0.69.1) 349 | - React-callinvoker (= 0.69.1) 350 | - React-Core (= 0.69.1) 351 | - React-cxxreact (= 0.69.1) 352 | - React-jsi (= 0.69.1) 353 | - React-logger (= 0.69.1) 354 | - React-perflogger (= 0.69.1) 355 | - SocketRocket (0.6.0) 356 | - Yoga (1.14.0) 357 | - YogaKit (1.18.1): 358 | - Yoga (~> 1.14) 359 | 360 | DEPENDENCIES: 361 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 362 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 363 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 364 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 365 | - Flipper (= 0.125.0) 366 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 367 | - Flipper-DoubleConversion (= 3.2.0.1) 368 | - Flipper-Fmt (= 7.1.7) 369 | - Flipper-Folly (= 2.6.10) 370 | - Flipper-Glog (= 0.5.0.5) 371 | - Flipper-PeerTalk (= 0.0.4) 372 | - Flipper-RSocket (= 1.4.3) 373 | - FlipperKit (= 0.125.0) 374 | - FlipperKit/Core (= 0.125.0) 375 | - FlipperKit/CppBridge (= 0.125.0) 376 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0) 377 | - FlipperKit/FBDefines (= 0.125.0) 378 | - FlipperKit/FKPortForwarding (= 0.125.0) 379 | - FlipperKit/FlipperKitHighlightOverlay (= 0.125.0) 380 | - FlipperKit/FlipperKitLayoutPlugin (= 0.125.0) 381 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0) 382 | - FlipperKit/FlipperKitNetworkPlugin (= 0.125.0) 383 | - FlipperKit/FlipperKitReactPlugin (= 0.125.0) 384 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0) 385 | - FlipperKit/SKIOSNetworkPlugin (= 0.125.0) 386 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 387 | - OpenSSL-Universal (= 1.1.1100) 388 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 389 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 390 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 391 | - React (from `../node_modules/react-native/`) 392 | - React-bridging (from `../node_modules/react-native/ReactCommon`) 393 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 394 | - React-Codegen (from `build/generated/ios`) 395 | - React-Core (from `../node_modules/react-native/`) 396 | - React-Core/DevSupport (from `../node_modules/react-native/`) 397 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 398 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 399 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 400 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 401 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 402 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 403 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 404 | - react-native-webview (from `../node_modules/react-native-webview`) 405 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 406 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 407 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 408 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 409 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 410 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 411 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 412 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 413 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 414 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 415 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 416 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 417 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 418 | 419 | SPEC REPOS: 420 | trunk: 421 | - CocoaAsyncSocket 422 | - Flipper 423 | - Flipper-Boost-iOSX 424 | - Flipper-DoubleConversion 425 | - Flipper-Fmt 426 | - Flipper-Folly 427 | - Flipper-Glog 428 | - Flipper-PeerTalk 429 | - Flipper-RSocket 430 | - FlipperKit 431 | - fmt 432 | - libevent 433 | - OpenSSL-Universal 434 | - SocketRocket 435 | - YogaKit 436 | 437 | EXTERNAL SOURCES: 438 | boost: 439 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 440 | DoubleConversion: 441 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 442 | FBLazyVector: 443 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 444 | FBReactNativeSpec: 445 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 446 | glog: 447 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 448 | RCT-Folly: 449 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 450 | RCTRequired: 451 | :path: "../node_modules/react-native/Libraries/RCTRequired" 452 | RCTTypeSafety: 453 | :path: "../node_modules/react-native/Libraries/TypeSafety" 454 | React: 455 | :path: "../node_modules/react-native/" 456 | React-bridging: 457 | :path: "../node_modules/react-native/ReactCommon" 458 | React-callinvoker: 459 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 460 | React-Codegen: 461 | :path: build/generated/ios 462 | React-Core: 463 | :path: "../node_modules/react-native/" 464 | React-CoreModules: 465 | :path: "../node_modules/react-native/React/CoreModules" 466 | React-cxxreact: 467 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 468 | React-jsi: 469 | :path: "../node_modules/react-native/ReactCommon/jsi" 470 | React-jsiexecutor: 471 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 472 | React-jsinspector: 473 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 474 | React-logger: 475 | :path: "../node_modules/react-native/ReactCommon/logger" 476 | react-native-webview: 477 | :path: "../node_modules/react-native-webview" 478 | React-perflogger: 479 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 480 | React-RCTActionSheet: 481 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 482 | React-RCTAnimation: 483 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 484 | React-RCTBlob: 485 | :path: "../node_modules/react-native/Libraries/Blob" 486 | React-RCTImage: 487 | :path: "../node_modules/react-native/Libraries/Image" 488 | React-RCTLinking: 489 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 490 | React-RCTNetwork: 491 | :path: "../node_modules/react-native/Libraries/Network" 492 | React-RCTSettings: 493 | :path: "../node_modules/react-native/Libraries/Settings" 494 | React-RCTText: 495 | :path: "../node_modules/react-native/Libraries/Text" 496 | React-RCTVibration: 497 | :path: "../node_modules/react-native/Libraries/Vibration" 498 | React-runtimeexecutor: 499 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 500 | ReactCommon: 501 | :path: "../node_modules/react-native/ReactCommon" 502 | Yoga: 503 | :path: "../node_modules/react-native/ReactCommon/yoga" 504 | 505 | SPEC CHECKSUMS: 506 | boost: a7c83b31436843459a1961bfd74b96033dc77234 507 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 508 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 509 | FBLazyVector: 068141206af867f72854753423d0117c4bf53419 510 | FBReactNativeSpec: 546a637adc797fa436dd51d1c63c580f820de31c 511 | Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 512 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 513 | Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30 514 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 515 | Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3 516 | Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446 517 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 518 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 519 | FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 520 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 521 | glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a 522 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 523 | OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c 524 | RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a 525 | RCTRequired: ae07282b2ec9c90d7eb98251603bc3f82403d239 526 | RCTTypeSafety: a04dc1339af2e1da759ccd093bf11c310dce1ef6 527 | React: dbd201f781b180eab148aa961683943c72f67dcf 528 | React-bridging: 10a863fdc0fc6f9c9f8527640936b293cd288bdc 529 | React-callinvoker: 6ad32eee2630dab9023de5df2a6a8cacbfc99a67 530 | React-Codegen: fe3423fa6f37d05e233ab0e85e34fe0b443a5654 531 | React-Core: 6177b1f2dd794fe202a5042d3678b2ddfcbfb7d4 532 | React-CoreModules: c74e6b155f9876b1947fc8a13f0cb437cc7f6dcd 533 | React-cxxreact: a07b7d90c4c71dd38c7383c7344b34d0a1336aee 534 | React-jsi: d762c410d10830b7579225c78f2fd881c29649ca 535 | React-jsiexecutor: 758e70947c232828a66b5ddc42d02b4d010fa26e 536 | React-jsinspector: 55605caf04e02f9b0e05842b786f1c12dde08f4b 537 | React-logger: ca970551cb7eea2fd814d0d5f6fc1a471eb53b76 538 | react-native-webview: 227ba9205abb8579116b69ea5774d9744267c65a 539 | React-perflogger: c9161ff0f1c769993cd11d2751e4331ff4ceb7cd 540 | React-RCTActionSheet: 2d885b0bea76a5254ef852939273edd8de116180 541 | React-RCTAnimation: 353fa4fc3c19060068832dd32e555182ec07be45 542 | React-RCTBlob: 647da863bc7d4f169bb80463fbcdd59c4fc76e6a 543 | React-RCTImage: e77ee8d85f21ad5f4704e3ef67656903f45f9e76 544 | React-RCTLinking: 3dad213f5ef5798b9491037aebe84e8ad684d4c4 545 | React-RCTNetwork: ebbb9581d8fdc91596a4ee5e9f9ae37d5f1e13b9 546 | React-RCTSettings: a5e7f3f1d1b38be8bf9baa89228c5af98244f9ee 547 | React-RCTText: 209576913f7eccd84425ea3f3813772f1f66e1e4 548 | React-RCTVibration: e8b7dd6635cc95689b5db643b5a3848f1e05b30b 549 | React-runtimeexecutor: 27f468c5576eaf05ffb7a907528e44c75a3fcbae 550 | ReactCommon: e30ec17dfb1d4c4f3419eac254350d6abca6d5a2 551 | SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 552 | Yoga: 7ab6e3ee4ce47d7b789d1cb520163833e515f452 553 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 554 | 555 | PODFILE CHECKSUM: 78431870a3f52741da93ea8f6a37644b2d4f82d3 556 | 557 | COCOAPODS: 1.11.2 558 | -------------------------------------------------------------------------------- /demo/ios/demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* demoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* demoTests.m */; }; 11 | 0C80B921A6F3F58F76C31292 /* libPods-demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-demo.a */; }; 12 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 15 | 7699B88040F8A987B510C191 /* libPods-demo-demoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-demo-demoTests.a */; }; 16 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 25 | remoteInfo = demo; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 00E356EE1AD99517003FC87E /* demoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = demoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 00E356F21AD99517003FC87E /* demoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = demoTests.m; sourceTree = ""; }; 33 | 13B07F961A680F5B00A75B9A /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = demo/AppDelegate.h; sourceTree = ""; }; 35 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = demo/AppDelegate.mm; sourceTree = ""; }; 36 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = demo/Images.xcassets; sourceTree = ""; }; 37 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = demo/Info.plist; sourceTree = ""; }; 38 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = demo/main.m; sourceTree = ""; }; 39 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-demo-demoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demo-demoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 3B4392A12AC88292D35C810B /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; 41 | 5709B34CF0A7D63546082F79 /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; 42 | 5B7EB9410499542E8C5724F5 /* Pods-demo-demoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo-demoTests.debug.xcconfig"; path = "Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests.debug.xcconfig"; sourceTree = ""; }; 43 | 5DCACB8F33CDC322A6C60F78 /* libPods-demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = demo/LaunchScreen.storyboard; sourceTree = ""; }; 45 | 89C6BE57DB24E9ADA2F236DE /* Pods-demo-demoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo-demoTests.release.xcconfig"; path = "Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests.release.xcconfig"; sourceTree = ""; }; 46 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 7699B88040F8A987B510C191 /* libPods-demo-demoTests.a in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 0C80B921A6F3F58F76C31292 /* libPods-demo.a in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 00E356EF1AD99517003FC87E /* demoTests */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 00E356F21AD99517003FC87E /* demoTests.m */, 73 | 00E356F01AD99517003FC87E /* Supporting Files */, 74 | ); 75 | path = demoTests; 76 | sourceTree = ""; 77 | }; 78 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 00E356F11AD99517003FC87E /* Info.plist */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | 13B07FAE1A68108700A75B9A /* demo */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 90 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 91 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 92 | 13B07FB61A68108700A75B9A /* Info.plist */, 93 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 94 | 13B07FB71A68108700A75B9A /* main.m */, 95 | ); 96 | name = demo; 97 | sourceTree = ""; 98 | }; 99 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 103 | 5DCACB8F33CDC322A6C60F78 /* libPods-demo.a */, 104 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-demo-demoTests.a */, 105 | ); 106 | name = Frameworks; 107 | sourceTree = ""; 108 | }; 109 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | ); 113 | name = Libraries; 114 | sourceTree = ""; 115 | }; 116 | 83CBB9F61A601CBA00E9B192 = { 117 | isa = PBXGroup; 118 | children = ( 119 | 13B07FAE1A68108700A75B9A /* demo */, 120 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 121 | 00E356EF1AD99517003FC87E /* demoTests */, 122 | 83CBBA001A601CBA00E9B192 /* Products */, 123 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 124 | BBD78D7AC51CEA395F1C20DB /* Pods */, 125 | ); 126 | indentWidth = 2; 127 | sourceTree = ""; 128 | tabWidth = 2; 129 | usesTabs = 0; 130 | }; 131 | 83CBBA001A601CBA00E9B192 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 13B07F961A680F5B00A75B9A /* demo.app */, 135 | 00E356EE1AD99517003FC87E /* demoTests.xctest */, 136 | ); 137 | name = Products; 138 | sourceTree = ""; 139 | }; 140 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 3B4392A12AC88292D35C810B /* Pods-demo.debug.xcconfig */, 144 | 5709B34CF0A7D63546082F79 /* Pods-demo.release.xcconfig */, 145 | 5B7EB9410499542E8C5724F5 /* Pods-demo-demoTests.debug.xcconfig */, 146 | 89C6BE57DB24E9ADA2F236DE /* Pods-demo-demoTests.release.xcconfig */, 147 | ); 148 | path = Pods; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 00E356ED1AD99517003FC87E /* demoTests */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "demoTests" */; 157 | buildPhases = ( 158 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, 159 | 00E356EA1AD99517003FC87E /* Sources */, 160 | 00E356EB1AD99517003FC87E /* Frameworks */, 161 | 00E356EC1AD99517003FC87E /* Resources */, 162 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, 163 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 169 | ); 170 | name = demoTests; 171 | productName = demoTests; 172 | productReference = 00E356EE1AD99517003FC87E /* demoTests.xctest */; 173 | productType = "com.apple.product-type.bundle.unit-test"; 174 | }; 175 | 13B07F861A680F5B00A75B9A /* demo */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "demo" */; 178 | buildPhases = ( 179 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 180 | FD10A7F022414F080027D42C /* Start Packager */, 181 | 13B07F871A680F5B00A75B9A /* Sources */, 182 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 183 | 13B07F8E1A680F5B00A75B9A /* Resources */, 184 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 185 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, 186 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | ); 192 | name = demo; 193 | productName = demo; 194 | productReference = 13B07F961A680F5B00A75B9A /* demo.app */; 195 | productType = "com.apple.product-type.application"; 196 | }; 197 | /* End PBXNativeTarget section */ 198 | 199 | /* Begin PBXProject section */ 200 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 201 | isa = PBXProject; 202 | attributes = { 203 | LastUpgradeCheck = 1210; 204 | TargetAttributes = { 205 | 00E356ED1AD99517003FC87E = { 206 | CreatedOnToolsVersion = 6.2; 207 | TestTargetID = 13B07F861A680F5B00A75B9A; 208 | }; 209 | 13B07F861A680F5B00A75B9A = { 210 | LastSwiftMigration = 1120; 211 | }; 212 | }; 213 | }; 214 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "demo" */; 215 | compatibilityVersion = "Xcode 12.0"; 216 | developmentRegion = en; 217 | hasScannedForEncodings = 0; 218 | knownRegions = ( 219 | en, 220 | Base, 221 | ); 222 | mainGroup = 83CBB9F61A601CBA00E9B192; 223 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 224 | projectDirPath = ""; 225 | projectRoot = ""; 226 | targets = ( 227 | 13B07F861A680F5B00A75B9A /* demo */, 228 | 00E356ED1AD99517003FC87E /* demoTests */, 229 | ); 230 | }; 231 | /* End PBXProject section */ 232 | 233 | /* Begin PBXResourcesBuildPhase section */ 234 | 00E356EC1AD99517003FC87E /* Resources */ = { 235 | isa = PBXResourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 242 | isa = PBXResourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 246 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXResourcesBuildPhase section */ 251 | 252 | /* Begin PBXShellScriptBuildPhase section */ 253 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 254 | isa = PBXShellScriptBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | inputPaths = ( 259 | "$(SRCROOT)/.xcode.env.local", 260 | "$(SRCROOT)/.xcode.env", 261 | ); 262 | name = "Bundle React Native code and images"; 263 | outputPaths = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | shellPath = /bin/sh; 267 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; 268 | }; 269 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { 270 | isa = PBXShellScriptBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | inputFileListPaths = ( 275 | "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", 276 | ); 277 | name = "[CP] Embed Pods Frameworks"; 278 | outputFileListPaths = ( 279 | "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | shellPath = /bin/sh; 283 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh\"\n"; 284 | showEnvVarsInLog = 0; 285 | }; 286 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { 287 | isa = PBXShellScriptBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | inputFileListPaths = ( 292 | ); 293 | inputPaths = ( 294 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 295 | "${PODS_ROOT}/Manifest.lock", 296 | ); 297 | name = "[CP] Check Pods Manifest.lock"; 298 | outputFileListPaths = ( 299 | ); 300 | outputPaths = ( 301 | "$(DERIVED_FILE_DIR)/Pods-demo-demoTests-checkManifestLockResult.txt", 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | shellPath = /bin/sh; 305 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 306 | showEnvVarsInLog = 0; 307 | }; 308 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 309 | isa = PBXShellScriptBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | ); 313 | inputFileListPaths = ( 314 | ); 315 | inputPaths = ( 316 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 317 | "${PODS_ROOT}/Manifest.lock", 318 | ); 319 | name = "[CP] Check Pods Manifest.lock"; 320 | outputFileListPaths = ( 321 | ); 322 | outputPaths = ( 323 | "$(DERIVED_FILE_DIR)/Pods-demo-checkManifestLockResult.txt", 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | shellPath = /bin/sh; 327 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 328 | showEnvVarsInLog = 0; 329 | }; 330 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { 331 | isa = PBXShellScriptBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | ); 335 | inputFileListPaths = ( 336 | "${PODS_ROOT}/Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 337 | ); 338 | name = "[CP] Embed Pods Frameworks"; 339 | outputFileListPaths = ( 340 | "${PODS_ROOT}/Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | shellPath = /bin/sh; 344 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests-frameworks.sh\"\n"; 345 | showEnvVarsInLog = 0; 346 | }; 347 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 348 | isa = PBXShellScriptBuildPhase; 349 | buildActionMask = 2147483647; 350 | files = ( 351 | ); 352 | inputFileListPaths = ( 353 | "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-resources-${CONFIGURATION}-input-files.xcfilelist", 354 | ); 355 | name = "[CP] Copy Pods Resources"; 356 | outputFileListPaths = ( 357 | "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-resources-${CONFIGURATION}-output-files.xcfilelist", 358 | ); 359 | runOnlyForDeploymentPostprocessing = 0; 360 | shellPath = /bin/sh; 361 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-resources.sh\"\n"; 362 | showEnvVarsInLog = 0; 363 | }; 364 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { 365 | isa = PBXShellScriptBuildPhase; 366 | buildActionMask = 2147483647; 367 | files = ( 368 | ); 369 | inputFileListPaths = ( 370 | "${PODS_ROOT}/Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests-resources-${CONFIGURATION}-input-files.xcfilelist", 371 | ); 372 | name = "[CP] Copy Pods Resources"; 373 | outputFileListPaths = ( 374 | "${PODS_ROOT}/Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests-resources-${CONFIGURATION}-output-files.xcfilelist", 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | shellPath = /bin/sh; 378 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo-demoTests/Pods-demo-demoTests-resources.sh\"\n"; 379 | showEnvVarsInLog = 0; 380 | }; 381 | FD10A7F022414F080027D42C /* Start Packager */ = { 382 | isa = PBXShellScriptBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | ); 386 | inputFileListPaths = ( 387 | ); 388 | inputPaths = ( 389 | ); 390 | name = "Start Packager"; 391 | outputFileListPaths = ( 392 | ); 393 | outputPaths = ( 394 | ); 395 | runOnlyForDeploymentPostprocessing = 0; 396 | shellPath = /bin/sh; 397 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 398 | showEnvVarsInLog = 0; 399 | }; 400 | /* End PBXShellScriptBuildPhase section */ 401 | 402 | /* Begin PBXSourcesBuildPhase section */ 403 | 00E356EA1AD99517003FC87E /* Sources */ = { 404 | isa = PBXSourcesBuildPhase; 405 | buildActionMask = 2147483647; 406 | files = ( 407 | 00E356F31AD99517003FC87E /* demoTests.m in Sources */, 408 | ); 409 | runOnlyForDeploymentPostprocessing = 0; 410 | }; 411 | 13B07F871A680F5B00A75B9A /* Sources */ = { 412 | isa = PBXSourcesBuildPhase; 413 | buildActionMask = 2147483647; 414 | files = ( 415 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 416 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 417 | ); 418 | runOnlyForDeploymentPostprocessing = 0; 419 | }; 420 | /* End PBXSourcesBuildPhase section */ 421 | 422 | /* Begin PBXTargetDependency section */ 423 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 424 | isa = PBXTargetDependency; 425 | target = 13B07F861A680F5B00A75B9A /* demo */; 426 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 427 | }; 428 | /* End PBXTargetDependency section */ 429 | 430 | /* Begin XCBuildConfiguration section */ 431 | 00E356F61AD99517003FC87E /* Debug */ = { 432 | isa = XCBuildConfiguration; 433 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-demo-demoTests.debug.xcconfig */; 434 | buildSettings = { 435 | BUNDLE_LOADER = "$(TEST_HOST)"; 436 | GCC_PREPROCESSOR_DEFINITIONS = ( 437 | "DEBUG=1", 438 | "$(inherited)", 439 | ); 440 | INFOPLIST_FILE = demoTests/Info.plist; 441 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 442 | LD_RUNPATH_SEARCH_PATHS = ( 443 | "$(inherited)", 444 | "@executable_path/Frameworks", 445 | "@loader_path/Frameworks", 446 | ); 447 | OTHER_LDFLAGS = ( 448 | "-ObjC", 449 | "-lc++", 450 | "$(inherited)", 451 | ); 452 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo.app/demo"; 455 | }; 456 | name = Debug; 457 | }; 458 | 00E356F71AD99517003FC87E /* Release */ = { 459 | isa = XCBuildConfiguration; 460 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-demo-demoTests.release.xcconfig */; 461 | buildSettings = { 462 | BUNDLE_LOADER = "$(TEST_HOST)"; 463 | COPY_PHASE_STRIP = NO; 464 | INFOPLIST_FILE = demoTests/Info.plist; 465 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 466 | LD_RUNPATH_SEARCH_PATHS = ( 467 | "$(inherited)", 468 | "@executable_path/Frameworks", 469 | "@loader_path/Frameworks", 470 | ); 471 | OTHER_LDFLAGS = ( 472 | "-ObjC", 473 | "-lc++", 474 | "$(inherited)", 475 | ); 476 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo.app/demo"; 479 | }; 480 | name = Release; 481 | }; 482 | 13B07F941A680F5B00A75B9A /* Debug */ = { 483 | isa = XCBuildConfiguration; 484 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-demo.debug.xcconfig */; 485 | buildSettings = { 486 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 487 | CLANG_ENABLE_MODULES = YES; 488 | CURRENT_PROJECT_VERSION = 1; 489 | ENABLE_BITCODE = NO; 490 | INFOPLIST_FILE = demo/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "@executable_path/Frameworks", 494 | ); 495 | OTHER_LDFLAGS = ( 496 | "$(inherited)", 497 | "-ObjC", 498 | "-lc++", 499 | ); 500 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 501 | PRODUCT_NAME = demo; 502 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 503 | SWIFT_VERSION = 5.0; 504 | VERSIONING_SYSTEM = "apple-generic"; 505 | }; 506 | name = Debug; 507 | }; 508 | 13B07F951A680F5B00A75B9A /* Release */ = { 509 | isa = XCBuildConfiguration; 510 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-demo.release.xcconfig */; 511 | buildSettings = { 512 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 513 | CLANG_ENABLE_MODULES = YES; 514 | CURRENT_PROJECT_VERSION = 1; 515 | INFOPLIST_FILE = demo/Info.plist; 516 | LD_RUNPATH_SEARCH_PATHS = ( 517 | "$(inherited)", 518 | "@executable_path/Frameworks", 519 | ); 520 | OTHER_LDFLAGS = ( 521 | "$(inherited)", 522 | "-ObjC", 523 | "-lc++", 524 | ); 525 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 526 | PRODUCT_NAME = demo; 527 | SWIFT_VERSION = 5.0; 528 | VERSIONING_SYSTEM = "apple-generic"; 529 | }; 530 | name = Release; 531 | }; 532 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 533 | isa = XCBuildConfiguration; 534 | buildSettings = { 535 | ALWAYS_SEARCH_USER_PATHS = NO; 536 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 537 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 538 | CLANG_CXX_LIBRARY = "libc++"; 539 | CLANG_ENABLE_MODULES = YES; 540 | CLANG_ENABLE_OBJC_ARC = YES; 541 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 542 | CLANG_WARN_BOOL_CONVERSION = YES; 543 | CLANG_WARN_COMMA = YES; 544 | CLANG_WARN_CONSTANT_CONVERSION = YES; 545 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 546 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 547 | CLANG_WARN_EMPTY_BODY = YES; 548 | CLANG_WARN_ENUM_CONVERSION = YES; 549 | CLANG_WARN_INFINITE_RECURSION = YES; 550 | CLANG_WARN_INT_CONVERSION = YES; 551 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 552 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 553 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 554 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 555 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 556 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 557 | CLANG_WARN_STRICT_PROTOTYPES = YES; 558 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 559 | CLANG_WARN_UNREACHABLE_CODE = YES; 560 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 561 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 562 | COPY_PHASE_STRIP = NO; 563 | ENABLE_STRICT_OBJC_MSGSEND = YES; 564 | ENABLE_TESTABILITY = YES; 565 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 566 | GCC_C_LANGUAGE_STANDARD = gnu99; 567 | GCC_DYNAMIC_NO_PIC = NO; 568 | GCC_NO_COMMON_BLOCKS = YES; 569 | GCC_OPTIMIZATION_LEVEL = 0; 570 | GCC_PREPROCESSOR_DEFINITIONS = ( 571 | "DEBUG=1", 572 | "$(inherited)", 573 | ); 574 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 575 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 576 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 577 | GCC_WARN_UNDECLARED_SELECTOR = YES; 578 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 579 | GCC_WARN_UNUSED_FUNCTION = YES; 580 | GCC_WARN_UNUSED_VARIABLE = YES; 581 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 582 | LD_RUNPATH_SEARCH_PATHS = ( 583 | /usr/lib/swift, 584 | "$(inherited)", 585 | ); 586 | LIBRARY_SEARCH_PATHS = ( 587 | "\"$(SDKROOT)/usr/lib/swift\"", 588 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 589 | "\"$(inherited)\"", 590 | ); 591 | MTL_ENABLE_DEBUG_INFO = YES; 592 | ONLY_ACTIVE_ARCH = YES; 593 | OTHER_CPLUSPLUSFLAGS = ( 594 | "$(OTHER_CFLAGS)", 595 | "-DFOLLY_NO_CONFIG", 596 | "-DFOLLY_MOBILE=1", 597 | "-DFOLLY_USE_LIBCPP=1", 598 | ); 599 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 600 | SDKROOT = iphoneos; 601 | }; 602 | name = Debug; 603 | }; 604 | 83CBBA211A601CBA00E9B192 /* Release */ = { 605 | isa = XCBuildConfiguration; 606 | buildSettings = { 607 | ALWAYS_SEARCH_USER_PATHS = NO; 608 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 609 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 610 | CLANG_CXX_LIBRARY = "libc++"; 611 | CLANG_ENABLE_MODULES = YES; 612 | CLANG_ENABLE_OBJC_ARC = YES; 613 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 614 | CLANG_WARN_BOOL_CONVERSION = YES; 615 | CLANG_WARN_COMMA = YES; 616 | CLANG_WARN_CONSTANT_CONVERSION = YES; 617 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 618 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 619 | CLANG_WARN_EMPTY_BODY = YES; 620 | CLANG_WARN_ENUM_CONVERSION = YES; 621 | CLANG_WARN_INFINITE_RECURSION = YES; 622 | CLANG_WARN_INT_CONVERSION = YES; 623 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 624 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 625 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 626 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 627 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 628 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 629 | CLANG_WARN_STRICT_PROTOTYPES = YES; 630 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 631 | CLANG_WARN_UNREACHABLE_CODE = YES; 632 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 633 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 634 | COPY_PHASE_STRIP = YES; 635 | ENABLE_NS_ASSERTIONS = NO; 636 | ENABLE_STRICT_OBJC_MSGSEND = YES; 637 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 638 | GCC_C_LANGUAGE_STANDARD = gnu99; 639 | GCC_NO_COMMON_BLOCKS = YES; 640 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 641 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 642 | GCC_WARN_UNDECLARED_SELECTOR = YES; 643 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 644 | GCC_WARN_UNUSED_FUNCTION = YES; 645 | GCC_WARN_UNUSED_VARIABLE = YES; 646 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 647 | LD_RUNPATH_SEARCH_PATHS = ( 648 | /usr/lib/swift, 649 | "$(inherited)", 650 | ); 651 | LIBRARY_SEARCH_PATHS = ( 652 | "\"$(SDKROOT)/usr/lib/swift\"", 653 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 654 | "\"$(inherited)\"", 655 | ); 656 | MTL_ENABLE_DEBUG_INFO = NO; 657 | OTHER_CPLUSPLUSFLAGS = ( 658 | "$(OTHER_CFLAGS)", 659 | "-DFOLLY_NO_CONFIG", 660 | "-DFOLLY_MOBILE=1", 661 | "-DFOLLY_USE_LIBCPP=1", 662 | ); 663 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 664 | SDKROOT = iphoneos; 665 | VALIDATE_PRODUCT = YES; 666 | }; 667 | name = Release; 668 | }; 669 | /* End XCBuildConfiguration section */ 670 | 671 | /* Begin XCConfigurationList section */ 672 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "demoTests" */ = { 673 | isa = XCConfigurationList; 674 | buildConfigurations = ( 675 | 00E356F61AD99517003FC87E /* Debug */, 676 | 00E356F71AD99517003FC87E /* Release */, 677 | ); 678 | defaultConfigurationIsVisible = 0; 679 | defaultConfigurationName = Release; 680 | }; 681 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "demo" */ = { 682 | isa = XCConfigurationList; 683 | buildConfigurations = ( 684 | 13B07F941A680F5B00A75B9A /* Debug */, 685 | 13B07F951A680F5B00A75B9A /* Release */, 686 | ); 687 | defaultConfigurationIsVisible = 0; 688 | defaultConfigurationName = Release; 689 | }; 690 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "demo" */ = { 691 | isa = XCConfigurationList; 692 | buildConfigurations = ( 693 | 83CBBA201A601CBA00E9B192 /* Debug */, 694 | 83CBBA211A601CBA00E9B192 /* Release */, 695 | ); 696 | defaultConfigurationIsVisible = 0; 697 | defaultConfigurationName = Release; 698 | }; 699 | /* End XCConfigurationList section */ 700 | }; 701 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 702 | } 703 | -------------------------------------------------------------------------------- /demo/ios/demo.xcodeproj/xcshareddata/xcschemes/demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /demo/ios/demo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/ios/demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /demo/ios/demo/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import 8 | 9 | #if RCT_NEW_ARCH_ENABLED 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | #import 18 | 19 | static NSString *const kRNConcurrentRoot = @"concurrentRoot"; 20 | 21 | @interface AppDelegate () { 22 | RCTTurboModuleManager *_turboModuleManager; 23 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 24 | std::shared_ptr _reactNativeConfig; 25 | facebook::react::ContextContainer::Shared _contextContainer; 26 | } 27 | @end 28 | #endif 29 | 30 | @implementation AppDelegate 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | RCTAppSetupPrepareApp(application); 35 | 36 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 37 | 38 | #if RCT_NEW_ARCH_ENABLED 39 | _contextContainer = std::make_shared(); 40 | _reactNativeConfig = std::make_shared(); 41 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 42 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 43 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 44 | #endif 45 | 46 | NSDictionary *initProps = [self prepareInitialProps]; 47 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"demo", initProps); 48 | 49 | if (@available(iOS 13.0, *)) { 50 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 51 | } else { 52 | rootView.backgroundColor = [UIColor whiteColor]; 53 | } 54 | 55 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 56 | UIViewController *rootViewController = [UIViewController new]; 57 | rootViewController.view = rootView; 58 | self.window.rootViewController = rootViewController; 59 | [self.window makeKeyAndVisible]; 60 | return YES; 61 | } 62 | 63 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. 64 | /// 65 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html 66 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). 67 | /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. 68 | - (BOOL)concurrentRootEnabled 69 | { 70 | // Switch this bool to turn on and off the concurrent root 71 | return true; 72 | } 73 | 74 | - (NSDictionary *)prepareInitialProps 75 | { 76 | NSMutableDictionary *initProps = [NSMutableDictionary new]; 77 | 78 | #ifdef RCT_NEW_ARCH_ENABLED 79 | initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); 80 | #endif 81 | 82 | return initProps; 83 | } 84 | 85 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 86 | { 87 | #if DEBUG 88 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 89 | #else 90 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 91 | #endif 92 | } 93 | 94 | #if RCT_NEW_ARCH_ENABLED 95 | 96 | #pragma mark - RCTCxxBridgeDelegate 97 | 98 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 99 | { 100 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 101 | delegate:self 102 | jsInvoker:bridge.jsCallInvoker]; 103 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 104 | } 105 | 106 | #pragma mark RCTTurboModuleManagerDelegate 107 | 108 | - (Class)getModuleClassFromName:(const char *)name 109 | { 110 | return RCTCoreModulesClassProvider(name); 111 | } 112 | 113 | - (std::shared_ptr)getTurboModule:(const std::string &)name 114 | jsInvoker:(std::shared_ptr)jsInvoker 115 | { 116 | return nullptr; 117 | } 118 | 119 | - (std::shared_ptr)getTurboModule:(const std::string &)name 120 | initParams: 121 | (const facebook::react::ObjCTurboModule::InitParams &)params 122 | { 123 | return nullptr; 124 | } 125 | 126 | - (id)getModuleInstanceFromClass:(Class)moduleClass 127 | { 128 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 129 | } 130 | 131 | #endif 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /demo/ios/demo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /demo/ios/demo/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /demo/ios/demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | demo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /demo/ios/demo/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/ios/demo/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /demo/ios/demoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /demo/ios/demoTests/demoTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface demoTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation demoTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /demo/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: true, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "react": "18.0.0", 14 | "react-native": "0.69.1", 15 | "react-native-autoheight-webview": "../", 16 | "react-native-webview": "^11.22.7" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.12.9", 20 | "@babel/runtime": "^7.12.5", 21 | "@react-native-community/eslint-config": "^2.0.0", 22 | "babel-jest": "^26.6.3", 23 | "eslint": "^7.32.0", 24 | "jest": "^26.6.3", 25 | "metro-react-native-babel-preset": "^0.70.3", 26 | "react-test-renderer": "18.0.0" 27 | }, 28 | "jest": { 29 | "preset": "react-native" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for react-native-autoheight-webview 1.x 2 | // Project: https://github.com/iou90/react-native-autoheight-webview 3 | // Definitions by: Naveen Ithappu 4 | // TypeScript Version: ^4.0.5 5 | 6 | import WebView, {WebViewProps} from 'react-native-webview'; 7 | 8 | import {StyleProp, ViewStyle} from 'react-native'; 9 | 10 | export interface StylesFile { 11 | href: string; 12 | type: string; 13 | rel: string; 14 | } 15 | 16 | export interface SizeUpdate { 17 | width: number; 18 | height: number; 19 | } 20 | 21 | export interface AutoHeightWebViewProps extends WebViewProps { 22 | onSizeUpdated?: (size: SizeUpdate) => void; 23 | files?: StylesFile[]; 24 | style?: StyleProp; 25 | customScript?: string; 26 | customStyle?: string; 27 | viewportContent?: string; 28 | scalesPageToFit?: boolean; 29 | scrollEnabledWithZoomedin?: boolean; 30 | } 31 | 32 | export default class AutoHeightWebView extends WebView< 33 | AutoHeightWebViewProps 34 | > {} 35 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import AutoHeightWebView from './autoHeightWebView/index'; 2 | 3 | export default AutoHeightWebView; 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-autoheight-webview", 3 | "version": "1.6.5", 4 | "description": "An auto height webview for React Native, even auto width for inline html", 5 | "main": "autoHeightWebView", 6 | "types": "index.d.ts", 7 | "files": [ 8 | "index.js", 9 | "index.d.ts", 10 | "autoHeightWebView" 11 | ], 12 | "scripts": { 13 | "test": "echo \"Error: no test specified\" && exit 1" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/iou90/react-native-autoheight-webview.git" 18 | }, 19 | "keywords": [ 20 | "react", 21 | "react-native", 22 | "autoheight", 23 | "webview" 24 | ], 25 | "author": "iou90", 26 | "license": "ISC", 27 | "bugs": { 28 | "url": "https://github.com/iou90/react-native-autoheight-webview/issues" 29 | }, 30 | "homepage": "https://github.com/iou90/react-native-autoheight-webview#readme", 31 | "peerDependencies": { 32 | "react": ">= 16.8.0", 33 | "react-native": ">= 0.60.0", 34 | "react-native-webview": ">= 10.9.0" 35 | }, 36 | "dependencies": { 37 | "deprecated-react-native-prop-types": "^2.3.0", 38 | "prop-types": "^15.7.2" 39 | }, 40 | "devDependencies": { 41 | "@react-native-community/eslint-config": "^2.0.0", 42 | "@typescript-eslint/parser": "^4.15.1", 43 | "babel-eslint": "^10.1.0", 44 | "eslint": "^7.20.0", 45 | "eslint-plugin-jsx": "^0.1.0", 46 | "eslint-plugin-react": "^7.22.0", 47 | "eslint-plugin-react-hooks": "^4.2.0", 48 | "eslint-plugin-react-native": "^3.10.0", 49 | "typescript": "^4.1.5" 50 | } 51 | } 52 | --------------------------------------------------------------------------------