├── .gitattributes ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── RNWindowGuard.podspec ├── android ├── README.md ├── build.gradle ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── github │ └── greenfrvr │ ├── RNWindowGuardModule.java │ └── RNWindowGuardPackage.java ├── example ├── App.js ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ └── DINAlternate-Bold.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ ├── UIVisibilityModule.java │ │ │ │ └── UIVisibilityPackage.java │ │ │ └── res │ │ │ ├── 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-v21 │ │ │ └── styles.xml │ │ │ ├── values-v28 │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── assets │ └── fonts │ │ └── DINAlternate-Bold.ttf ├── babel.config.js ├── index.js ├── ios │ ├── example-Bridging-Header.h │ ├── example-tvOS │ │ └── Info.plist │ ├── example-tvOSTests │ │ └── Info.plist │ ├── example.swift │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── example-tvOS.xcscheme │ │ │ └── example.xcscheme │ └── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m ├── metro.config.js ├── package-lock.json ├── package.json ├── snapshot_android.png ├── snapshot_ios.png └── yarn.lock ├── index.d.ts ├── index.js ├── ios ├── RNWindowGuard-Bridging-Header.h ├── RNWindowGuard.m ├── RNWindowGuard.swift └── RNWindowGuard.xcodeproj │ └── project.pbxproj ├── package-lock.json ├── package.json ├── scripts └── examples_postinstall.js └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | 33 | # Android/IntelliJ 34 | # 35 | build/ 36 | .idea 37 | .gradle 38 | local.properties 39 | *.iml 40 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | *.keystore 45 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | example 3 | node_modules 4 | android/build 5 | xcuserdata 6 | *.iml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Artsiom Grintsevich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-window-guard 2 | 3 | [![npm package](https://img.shields.io/github/package-json/v/greenfrvr/react-native-window-guard.svg)](https://www.npmjs.com/package/react-native-window-guard) 4 | [![license](https://img.shields.io/github/license/greenfrvr/react-native-window-guard.svg)](https://github.com/greenfrvr/react-native-window-guard/blob/master/LICENSE) 5 | 6 | 7 | Project represents simple way to handle notches and system ui decorations for React Native. In comparison to alternatives (e.g. `SafeAreaView`) it works on both iOS and Android and doesn't use hardcoded values, getting all insets with operating system APIs instead. 8 | 9 | Android | iOS 10 | :-------------------------:|:-------------------------: 11 | | 12 | 13 | ## Getting started 14 | 15 | `$ npm install react-native-window-guard --save` 16 | 17 | ### Mostly automatic installation 18 | 19 | `$ react-native link react-native-window-guard` 20 | 21 | ### Manual installation 22 | 23 | 24 | #### iOS 25 | 26 | 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 27 | 2. Go to `node_modules` ➜ `react-native-window-guard` and add `RNWindowGuard.xcodeproj` 28 | 3. In XCode, in the project navigator, select your project. Add `libRNWindowGuard.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` 29 | 4. Run your project (`Cmd+R`)< 30 | 31 | #### Android 32 | 33 | 1. Open up `android/app/src/main/java/[...]/MainApplication.java` 34 | - Add `import com.github.greenfrvr.RNWindowGuardPackage;` to the imports at the top of the file 35 | - Add `new RNWindowGuardPackage()` to the list returned by the `getPackages()` method 36 | 2. Append the following lines to `android/settings.gradle`: 37 | ``` 38 | include ':react-native-window-guard' 39 | project(':react-native-window-guard').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-window-guard/android') 40 | ``` 41 | 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: 42 | ``` 43 | compile project(':react-native-window-guard') 44 | ``` 45 | 46 | 47 | ## Usage 48 | Put your layout inside `WindowGuard` component and define which insets you want to be applied. To make this use `applyInsets` prop. It takes array with sides which should be affected with insets. Available values: `top`, `bottom`, `left`, `right`. After this relevant window insets will be requested from native and applied as paddings to `WindowGuard` component. 49 | 50 | For convenience and better perfomance there are serveral insets configurations that are predefined. They are defined statically in `WindowGuard`. Available predefined insets configurations are: 51 | - `left` 52 | - `right` 53 | - `top` 54 | - `bottom` 55 | - `vertical` 56 | - `horizontal` 57 | - `all` 58 | 59 | Below is an example of applying insets both for top and bottom sides of your content: 60 | 61 | ```javascript 62 | import WindowGuard from 'react-native-window-guard'; 63 | 64 | export default class App extends React.Component { 65 | 66 | componentDidMount() { 67 | WindowGuard.requestWindowInsets(); 68 | } 69 | 70 | render() { 71 | return ( 72 | 75 | //content 76 | 77 | ); 78 | } 79 | } 80 | ``` 81 | Notice that you can still add paddings to `WindowGuard` and they will be added to applied window insets. Currently all paddings definitions are supported includeing `paddingHorizontal`, `paddingVertical` and `padding` attributes. 82 | 83 | ## Dynamic changes 84 | 85 | Window guard will handle orientation changes and apply new relevant insets automatically for you. Unfortunately there are still cases where you need to handle some ui changes manually. For example hiding status bar. You can request window guard to refresh insets after configuation change by calling `adjustInsets` method. Below is small usage example: 86 | 87 | ```javascript 88 | import WindowGuard from 'react-native-window-guard'; 89 | 90 | export default class App extends React.Component { 91 | 92 | toggleStatusBar = () => { 93 | //change statusBarHidden state 94 | StatusBar.setHidden(statusBarHidden, true); //change system ui views state 95 | this.container && this.container.adjustInsets() //request to refresh insets values 96 | }; 97 | 98 | render() { 99 | return ( 100 | this.container = r} 102 | style={{flex: 1}} 103 | applyInsets={WindowGuard.all}> 104 | //content 105 | 106 | ); 107 | } 108 | } 109 | ``` 110 | 111 | ## HOC 112 | For convenience there is HOC wich will simplify `WindowGuard` usage. `withWindowGuard` HOC will return component wrapped into `WindowGuard` with defined insets configuration. For example 113 | 114 | `const GuardedView = withWindowGuard(View, WindowGuard.all)` 115 | 116 | will return `View` component wrapped into `WindowGuard` with insets applied to all sides. 117 | -------------------------------------------------------------------------------- /RNWindowGuard.podspec: -------------------------------------------------------------------------------- 1 | require "json" 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, "package.json"))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "RNWindowGuard" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | RNWindowGuard 11 | DESC 12 | s.homepage = "https://github.com/author/RNWindowGuard" 13 | s.license = package["license"] 14 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 15 | s.author = { "author" => package["author"]["email"] } 16 | s.platform = :ios, "7.0" 17 | s.source = { :git => "#{package["repository"]["baseUrl"]}.git", :tag => "#{s.version}" } 18 | 19 | s.source_files = "ios/**/*.{h,m,swift}" 20 | s.requires_arc = true 21 | 22 | s.dependency "React" 23 | #s.dependency "others" 24 | end 25 | 26 | -------------------------------------------------------------------------------- /android/README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm: 5 | 6 | 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed 7 | 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK 8 | ``` 9 | ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle 10 | sdk.dir=/Users/{username}/Library/Android/sdk 11 | ``` 12 | 3. Delete the `maven` folder 13 | 4. Run `sudo ./gradlew installArchives` 14 | 5. Verify that latest set of generated files is in the maven folder with the correct version number 15 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | // Matches the RN Hello World template 9 | // https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L8 10 | classpath 'com.android.tools.build:gradle:3.4.0' 11 | } 12 | } 13 | 14 | apply plugin: 'com.android.library' 15 | apply plugin: 'maven' 16 | 17 | def safeExtGet(prop, fallback) { 18 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 19 | } 20 | 21 | def DEFAULT_MIN_SDK_VERSION = 16 22 | def DEFAULT_TARGET_SDK_VERSION = 28 23 | 24 | android { 25 | compileSdkVersion = 28 26 | buildToolsVersion = '28.0.3' 27 | 28 | defaultConfig { 29 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 30 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 31 | versionCode 1 32 | versionName "1.0" 33 | } 34 | lintOptions { 35 | abortOnError false 36 | } 37 | compileOptions { 38 | sourceCompatibility = '1.8' 39 | targetCompatibility = '1.8' 40 | } 41 | } 42 | 43 | repositories { 44 | google() 45 | maven { 46 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 47 | // Matches the RN Hello World template 48 | // https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21 49 | url "$projectDir/../node_modules/react-native/android" 50 | } 51 | mavenCentral() 52 | } 53 | 54 | dependencies { 55 | implementation 'com.facebook.react:react-native:+' 56 | implementation 'com.android.support:appcompat-v7:28.0.0' 57 | } 58 | 59 | def configureReactNativePom(def pom) { 60 | def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text) 61 | 62 | pom.project { 63 | name packageJson.title 64 | artifactId packageJson.name 65 | version = packageJson.version 66 | group = "com.github.greenfrvr" 67 | description packageJson.description 68 | url packageJson.repository.baseUrl 69 | 70 | licenses { 71 | license { 72 | name packageJson.license 73 | url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename 74 | distribution 'repo' 75 | } 76 | } 77 | 78 | developers { 79 | developer { 80 | id packageJson.author.username 81 | name packageJson.author.name 82 | } 83 | } 84 | } 85 | } 86 | 87 | afterEvaluate { project -> 88 | 89 | task androidJavadoc(type: Javadoc) { 90 | source = android.sourceSets.main.java.srcDirs 91 | classpath += files(android.bootClasspath) 92 | classpath += files(project.getConfigurations().getByName('compile').asList()) 93 | include '**/*.java' 94 | } 95 | 96 | task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) { 97 | classifier = 'javadoc' 98 | from androidJavadoc.destinationDir 99 | } 100 | 101 | task androidSourcesJar(type: Jar) { 102 | classifier = 'sources' 103 | from android.sourceSets.main.java.srcDirs 104 | include '**/*.java' 105 | } 106 | 107 | android.libraryVariants.all { variant -> 108 | def name = variant.name.capitalize() 109 | task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { 110 | from variant.javaCompile.destinationDir 111 | } 112 | } 113 | 114 | artifacts { 115 | archives androidSourcesJar 116 | archives androidJavadocJar 117 | } 118 | 119 | task installArchives(type: Upload) { 120 | configuration = configurations.archives 121 | repositories.mavenDeployer { 122 | // Deploy to react-native-event-bridge/maven, ready to publish to npm 123 | repository url: "file://${projectDir}/../android/maven" 124 | 125 | configureReactNativePom pom 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 29 14:10:34 MSK 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/github/greenfrvr/RNWindowGuardModule.java: -------------------------------------------------------------------------------- 1 | package com.github.greenfrvr; 2 | 3 | import android.graphics.Rect; 4 | import android.os.Build; 5 | import android.support.annotation.StringDef; 6 | import android.support.v4.view.DisplayCutoutCompat; 7 | import android.support.v4.view.ViewCompat; 8 | import android.support.v4.view.WindowInsetsCompat; 9 | import android.util.DisplayMetrics; 10 | import android.util.Log; 11 | import android.view.View; 12 | import android.view.Window; 13 | 14 | import com.facebook.react.bridge.Arguments; 15 | import com.facebook.react.bridge.Promise; 16 | import com.facebook.react.bridge.ReactApplicationContext; 17 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 18 | import com.facebook.react.bridge.ReactMethod; 19 | import com.facebook.react.bridge.WritableMap; 20 | 21 | import java.lang.annotation.Retention; 22 | 23 | import javax.annotation.Nonnull; 24 | 25 | import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; 26 | import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; 27 | import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; 28 | import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; 29 | import static android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN; 30 | import static android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; 31 | import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; 32 | import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; 33 | import static java.lang.annotation.RetentionPolicy.SOURCE; 34 | 35 | public class RNWindowGuardModule extends ReactContextBaseJavaModule { 36 | 37 | private static final String TAG = RNWindowGuardModule.class.getSimpleName(); 38 | 39 | public static final String MODULE_NAME = "RNWindowGuard"; 40 | 41 | @Retention(SOURCE) 42 | @StringDef({LEFT, TOP, RIGHT, BOTTOM, NOTCH}) 43 | public @interface WindowInsets { 44 | } 45 | 46 | public static final String LEFT = "leftInset"; 47 | public static final String TOP = "topInset"; 48 | public static final String RIGHT = "rightInset"; 49 | public static final String BOTTOM = "bottomInset"; 50 | public static final String NOTCH = "hasNotch"; 51 | 52 | private float density; 53 | 54 | public RNWindowGuardModule(@Nonnull ReactApplicationContext reactContext) { 55 | super(reactContext); 56 | density = ((float) reactContext.getResources().getDisplayMetrics().densityDpi / DisplayMetrics.DENSITY_DEFAULT); 57 | } 58 | 59 | @Nonnull 60 | @Override 61 | public String getName() { 62 | return MODULE_NAME; 63 | } 64 | 65 | @ReactMethod 66 | public void requestWindowInsets(Promise promise) { 67 | if (getCurrentActivity() == null || getCurrentActivity().getWindow() == null) { 68 | return; 69 | } 70 | 71 | Window window = getCurrentActivity().getWindow(); 72 | View view = window.getDecorView().getRootView(); 73 | 74 | ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> { 75 | int uiOptions = getCurrentActivity().getWindow().getDecorView().getSystemUiVisibility(); 76 | int windowOptions = getCurrentActivity().getWindow().getAttributes().flags; 77 | WritableMap insetsMap = convertToWindowInsetsMap(insets, uiOptions, windowOptions); 78 | promise.resolve(insetsMap); 79 | return insets.consumeSystemWindowInsets(); 80 | }); 81 | 82 | view.post(() -> ViewCompat.requestApplyInsets(view)); 83 | } 84 | 85 | private WritableMap convertToWindowInsetsMap(WindowInsetsCompat insets, int uiOptions, int windowOptions) { 86 | WritableMap map = createEmptyInsetsMap(); 87 | 88 | applyStatusBarVisibility(map, insets, uiOptions, windowOptions); 89 | applyNavigationBarVisibility(map, insets, uiOptions, windowOptions); 90 | 91 | adjustWindowInsetsWithCutout(map, insets.getDisplayCutout()); 92 | 93 | return map; 94 | } 95 | 96 | private void applyStatusBarVisibility(WritableMap map, WindowInsetsCompat insets, int uiOptions, int windowOptions) { 97 | boolean isStatusBarHidden = (windowOptions & FLAG_FULLSCREEN) != 0 || (uiOptions & SYSTEM_UI_FLAG_FULLSCREEN) != 0; 98 | boolean isLayoutUnderStatusBar = (uiOptions & SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0 || (windowOptions & FLAG_LAYOUT_IN_SCREEN) != 0; 99 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 100 | isLayoutUnderStatusBar = isLayoutUnderStatusBar || (windowOptions & FLAG_TRANSLUCENT_STATUS) != 0; 101 | } 102 | 103 | Log.d(TAG, "===== Is status bar hidden: " + isStatusBarHidden); 104 | Log.d(TAG, "===== Is content below status bar: " + isLayoutUnderStatusBar); 105 | 106 | if (isLayoutUnderStatusBar && !isStatusBarHidden) { 107 | map.putDouble(TOP, pxToDp(insets.getSystemWindowInsetTop())); 108 | } 109 | } 110 | 111 | private void applyNavigationBarVisibility(WritableMap map, WindowInsetsCompat insets, int uiOptions, int windowOptions) { 112 | boolean isNavigationBarHidden = (uiOptions & SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0; 113 | boolean isLayoutUnderNavigationBar = (uiOptions & SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0; 114 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 115 | isLayoutUnderNavigationBar = isLayoutUnderNavigationBar || (windowOptions & FLAG_TRANSLUCENT_NAVIGATION) != 0; 116 | } 117 | 118 | Log.d(TAG, "===== Is navigation bar hidden: " + isNavigationBarHidden); 119 | Log.d(TAG, "===== Is content below navigation bar: " + isLayoutUnderNavigationBar); 120 | 121 | if (isLayoutUnderNavigationBar && !isNavigationBarHidden) { 122 | map.putDouble(LEFT, pxToDp(insets.getSystemWindowInsetLeft())); 123 | map.putDouble(BOTTOM, pxToDp(insets.getSystemWindowInsetBottom())); 124 | map.putDouble(RIGHT, pxToDp(insets.getSystemWindowInsetRight())); 125 | } 126 | } 127 | 128 | private void adjustWindowInsetsWithCutout(WritableMap map, DisplayCutoutCompat displayCutout) { 129 | map.putBoolean(NOTCH, displayCutout != null); 130 | if (displayCutout != null) { 131 | if (map.getDouble(LEFT) == 0 && displayCutout.getSafeInsetLeft() != 0) { 132 | map.putDouble(LEFT, pxToDp(displayCutout.getSafeInsetLeft())); 133 | } 134 | 135 | if (map.getDouble(RIGHT) == 0 && displayCutout.getSafeInsetRight() != 0) { 136 | map.putDouble(RIGHT, pxToDp(displayCutout.getSafeInsetRight())); 137 | } 138 | 139 | if (map.getDouble(TOP) == 0 && displayCutout.getSafeInsetTop() > 0) { 140 | map.putDouble(TOP, pxToDp(displayCutout.getSafeInsetTop())); 141 | } 142 | 143 | if (map.getDouble(BOTTOM) == 0 && displayCutout.getSafeInsetBottom() != 0) { 144 | map.putDouble(BOTTOM, pxToDp(displayCutout.getSafeInsetBottom())); 145 | } 146 | 147 | printCutout(displayCutout); 148 | } 149 | } 150 | 151 | private WritableMap createEmptyInsetsMap() { 152 | WritableMap map = Arguments.createMap(); 153 | map.putDouble(LEFT, 0); 154 | map.putDouble(TOP, 0); 155 | map.putDouble(RIGHT, 0); 156 | map.putDouble(BOTTOM, 0); 157 | return map; 158 | } 159 | 160 | private float pxToDp(float px) { 161 | return px / density; 162 | } 163 | 164 | private void printCutout(DisplayCutoutCompat cutout) { 165 | Log.i(TAG, "========= Cutout Insets:"); 166 | Log.i(TAG, "=== Cutout Insets [top] " + cutout.getSafeInsetTop()); 167 | Log.i(TAG, "=== Cutout Insets [bottom] " + cutout.getSafeInsetBottom()); 168 | Log.i(TAG, "=== Cutout Insets [left] " + cutout.getSafeInsetLeft()); 169 | Log.i(TAG, "=== Cutout Insets [right] " + cutout.getSafeInsetRight()); 170 | 171 | Log.i(TAG, "=== Cutout rectangles: "); 172 | for (Rect rect : cutout.getBoundingRects()) { 173 | Log.i(TAG, rect.toString()); 174 | } 175 | Log.i(TAG, "=================="); 176 | } 177 | 178 | private void printInsets(WindowInsetsCompat inset) { 179 | Log.i(TAG, "========= Window Insets:"); 180 | 181 | Log.i(TAG, "=== Stable Insets [top] " + inset.getStableInsetTop()); 182 | Log.i(TAG, "=== Stable Insets [bottom] " + inset.getStableInsetBottom()); 183 | Log.i(TAG, "=== Stable Insets [left] " + inset.getStableInsetLeft()); 184 | Log.i(TAG, "=== Stable Insets [right] " + inset.getStableInsetRight()); 185 | 186 | Log.i(TAG, "=== System Insets [top] " + inset.getSystemWindowInsetTop()); 187 | Log.i(TAG, "=== System Insets [bottom] " + inset.getSystemWindowInsetBottom()); 188 | Log.i(TAG, "=== System Insets [left] " + inset.getSystemWindowInsetLeft()); 189 | Log.i(TAG, "=== System Insets [right] " + inset.getSystemWindowInsetRight()); 190 | Log.i(TAG, "=================="); 191 | } 192 | } 193 | -------------------------------------------------------------------------------- /android/src/main/java/com/github/greenfrvr/RNWindowGuardPackage.java: -------------------------------------------------------------------------------- 1 | package com.github.greenfrvr; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.bridge.NativeModule; 9 | import com.facebook.react.bridge.ReactApplicationContext; 10 | import com.facebook.react.uimanager.ViewManager; 11 | import com.facebook.react.bridge.JavaScriptModule; 12 | 13 | public class RNWindowGuardPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNWindowGuardModule(reactContext)); 17 | } 18 | 19 | @Override 20 | public List createViewManagers(ReactApplicationContext reactContext) { 21 | return Collections.emptyList(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | Platform, 4 | StyleSheet, 5 | Text, 6 | View, 7 | StatusBar, 8 | TouchableOpacity, 9 | NativeModules 10 | } from 'react-native'; 11 | import WindowGuard, {withWindowGuard} from 'react-native-window-guard'; 12 | 13 | const {UIVisibility} = NativeModules; 14 | const GuardedView = withWindowGuard(View, WindowGuard.all); 15 | 16 | const mainColor = '#A5DA34'; 17 | const title = Platform.select({ios: 'IOS', android: 'ANDROID'}); 18 | const subtitle = Platform.select({ios: 'Safe Area', android: 'Window Insets'}); 19 | const toggleStatusBar = 'Toggle status bar'; 20 | const toggleNavigationBar = 'Toggle navigation bar'; 21 | 22 | export default class App extends React.Component { 23 | 24 | constructor(props) { 25 | super(props); 26 | this.container = React.createRef(); 27 | 28 | this.statusBarHidden = false; 29 | this.navigationBarHidden = true; 30 | } 31 | 32 | componentDidMount() { 33 | WindowGuard.requestWindowInsets(); 34 | } 35 | 36 | toggleStatusBar = () => { 37 | this.statusBarHidden = !this.statusBarHidden; 38 | if (Platform.OS === 'ios') { 39 | StatusBar.setHidden(this.statusBarHidden, true); 40 | } else { 41 | UIVisibility.changeStatusBarVisibility(this.statusBarHidden); 42 | } 43 | this.container.current.adjustInsets() 44 | }; 45 | 46 | //Android only 47 | toggleNavigationBar = () => { 48 | this.navigationBarHidden = !this.navigationBarHidden; 49 | UIVisibility.changeNavigationBarVisibility(this.navigationBarHidden); 50 | this.container.current.adjustInsets() 51 | }; 52 | 53 | navigationBarButton = () => { 54 | return (Platform.OS === 'android' && 55 | 56 | 59 | {toggleNavigationBar} 60 | 61 | ); 62 | }; 63 | 64 | render() { 65 | return ( 66 | 69 | 70 | {title} 71 | {subtitle} 72 | 73 | 74 | 77 | {toggleStatusBar} 78 | 79 | {this.navigationBarButton()} 80 | 81 | 82 | ); 83 | } 84 | } 85 | 86 | const styles = StyleSheet.create({ 87 | container: { 88 | flex: 1, 89 | justifyContent: 'center', 90 | alignItems: 'center', 91 | backgroundColor: '#222222', 92 | }, 93 | topContainer: { 94 | flex: 5, 95 | alignItems: 'center', 96 | justifyContent: 'center' 97 | }, 98 | bottomContainer: { 99 | flex: 4, 100 | alignItems: 'center', 101 | justifyContent: 'center' 102 | }, 103 | title: { 104 | fontSize: Platform.select({ 105 | ios: 84, 106 | android: 43, 107 | }), 108 | textAlign: 'center', 109 | fontFamily: 'DIN Alternate', 110 | color: mainColor 111 | }, 112 | button: { 113 | paddingHorizontal: 16, 114 | paddingVertical: 8 115 | }, 116 | navigationButton: { 117 | marginTop: 8 118 | }, 119 | buttonTitle: { 120 | fontSize: 16, 121 | fontFamily: 'DIN Alternate', 122 | color: mainColor 123 | }, 124 | subtitle: { 125 | fontSize: 28, 126 | fontFamily: 'DIN Alternate', 127 | textAlign: 'center', 128 | marginBottom: 10, 129 | color: mainColor 130 | } 131 | }); 132 | -------------------------------------------------------------------------------- /example/__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 | -------------------------------------------------------------------------------- /example/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.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 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 | -------------------------------------------------------------------------------- /example/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 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 28 98 | 99 | compileOptions { 100 | sourceCompatibility = 1.8 101 | targetCompatibility = 1.8 102 | } 103 | 104 | defaultConfig { 105 | applicationId 'com.github.greenfrvr.example' 106 | minSdkVersion rootProject.ext.minSdkVersion 107 | targetSdkVersion rootProject.ext.targetSdkVersion 108 | versionCode 1 109 | versionName "1.0" 110 | } 111 | splits { 112 | abi { 113 | reset() 114 | enable enableSeparateBuildPerCPUArchitecture 115 | universalApk false // If true, also generate a universal APK 116 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 117 | } 118 | } 119 | buildTypes { 120 | release { 121 | minifyEnabled enableProguardInReleaseBuilds 122 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 123 | } 124 | } 125 | buildToolsVersion = '28.0.3' 126 | // applicationVariants are e.g. debug, release 127 | applicationVariants.all { variant -> 128 | variant.outputs.each { output -> 129 | // For each separate APK per architecture, set a unique version code as described here: 130 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 131 | def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4] 132 | def abi = output.getFilter(OutputFile.ABI) 133 | if (abi != null) { // null for the universal-debug, universal-release variants 134 | output.versionCodeOverride = 135 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 136 | } 137 | } 138 | } 139 | } 140 | 141 | dependencies { 142 | implementation project(':react-native-window-guard') 143 | implementation fileTree(dir: "libs", include: ["*.jar"]) 144 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 145 | implementation "com.facebook.react:react-native:+" 146 | } 147 | 148 | // Run this once to be able to run the application with BUCK 149 | // puts all compile dependencies into folder libs for BUCK to use 150 | task copyDownloadableDepsToLibs(type: Copy) { 151 | from configurations.compile 152 | into 'libs' 153 | } 154 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/assets/fonts/DINAlternate-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/assets/fonts/DINAlternate-Bold.ttf -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.os.Build; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.view.Window; 7 | import android.view.WindowManager; 8 | 9 | import com.facebook.react.ReactActivity; 10 | 11 | public class MainActivity extends ReactActivity { 12 | 13 | /** 14 | * Returns the name of the main component registered from JavaScript. 15 | * This is used to schedule rendering of the component. 16 | */ 17 | @Override 18 | protected String getMainComponentName() { 19 | return "example"; 20 | } 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | 26 | Window w = getWindow(); 27 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 28 | // w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); 29 | // w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 30 | // w.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 31 | } 32 | 33 | View decorView = getWindow().getDecorView(); 34 | int uiOptions = 0; 35 | uiOptions |= View.SYSTEM_UI_FLAG_LAYOUT_STABLE; 36 | uiOptions |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; 37 | uiOptions |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; 38 | 39 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 40 | uiOptions |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; 41 | uiOptions |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; 42 | } 43 | 44 | // 45 | // uiOptions |= View.SYSTEM_UI_FLAG_FULLSCREEN; 46 | // uiOptions |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; 47 | // uiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; 48 | 49 | decorView.setSystemUiVisibility(uiOptions); 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | import com.github.greenfrvr.RNWindowGuardPackage; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage(), 27 | new UIVisibilityPackage(), 28 | new RNWindowGuardPackage() 29 | ); 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/UIVisibilityModule.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.os.Build; 4 | import android.view.View; 5 | 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 8 | import com.facebook.react.bridge.ReactMethod; 9 | 10 | import javax.annotation.Nonnull; 11 | 12 | import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; 13 | import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; 14 | import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; 15 | import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; 16 | import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; 17 | import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; 18 | 19 | public class UIVisibilityModule extends ReactContextBaseJavaModule { 20 | 21 | public UIVisibilityModule(@Nonnull ReactApplicationContext reactContext) { 22 | super(reactContext); 23 | } 24 | 25 | @Nonnull 26 | @Override 27 | public String getName() { 28 | return "UIVisibility"; 29 | } 30 | 31 | @ReactMethod 32 | public void changeStatusBarVisibility(boolean visible) { 33 | if (getCurrentActivity() == null) { 34 | return; 35 | } 36 | 37 | View decorView = getCurrentActivity().getWindow().getDecorView(); 38 | decorView.post(() -> applyUIOption(decorView, SYSTEM_UI_FLAG_FULLSCREEN, visible)); 39 | } 40 | 41 | @ReactMethod 42 | public void changeNavigationBarVisibility(boolean visible) { 43 | if (getCurrentActivity() == null) { 44 | return; 45 | } 46 | 47 | View decorView = getCurrentActivity().getWindow().getDecorView(); 48 | decorView.post(() -> applyUIOption(decorView, SYSTEM_UI_FLAG_HIDE_NAVIGATION, visible)); 49 | } 50 | 51 | private void applyUIOption(View decorView, int flag, boolean visible) { 52 | int uiOptions = baseUIOptions(); 53 | 54 | if (!visible) { 55 | uiOptions |= flag; 56 | } 57 | 58 | decorView.setSystemUiVisibility(uiOptions); 59 | } 60 | 61 | private int baseUIOptions() { 62 | int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE 63 | | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 64 | | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; 65 | 66 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 67 | uiOptions |= SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; 68 | } 69 | 70 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 71 | uiOptions |= SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR; 72 | } 73 | 74 | return uiOptions; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/UIVisibilityPackage.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.NativeModule; 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.uimanager.ViewManager; 7 | 8 | import java.util.Collections; 9 | import java.util.List; 10 | 11 | import javax.annotation.Nonnull; 12 | 13 | public class UIVisibilityPackage implements ReactPackage { 14 | 15 | @Nonnull 16 | @Override 17 | public List createNativeModules(@Nonnull ReactApplicationContext reactContext) { 18 | return Collections.singletonList(new UIVisibilityModule(reactContext)); 19 | } 20 | 21 | @Nonnull 22 | @Override 23 | public List createViewManagers(@Nonnull ReactApplicationContext reactContext) { 24 | return Collections.emptyList(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-v28/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #A5DA34 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | supportLibVersion = "28.0.0" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.3.1' 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenLocal() 26 | google() 27 | jcenter() 28 | maven { 29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 30 | url "$rootDir/../node_modules/react-native/android" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example/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: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 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 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | include ':react-native-window-guard' 3 | project(':react-native-window-guard').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-window-guard/android') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/assets/fonts/DINAlternate-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/assets/fonts/DINAlternate-Bold.ttf -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/example-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /example/ios/example-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/example-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 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 | -------------------------------------------------------------------------------- /example/ios/example.swift: -------------------------------------------------------------------------------- 1 | // 2 | // example.swift 3 | // example 4 | // 5 | // Created by Артем Гринцевич on 4/30/19. 6 | // Copyright © 2019 Facebook. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | /* Begin PBXBuildFile section */ 9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 14 | 11BDCCDF22777F9B00487329 /* libRNWindowGuard.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 11BDCCCE22777C5300487329 /* libRNWindowGuard.a */; }; 15 | 11BDCD6A22781A7300487329 /* example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11BDCD6922781A7300487329 /* example.swift */; }; 16 | 11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 17 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 18 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 19 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 20 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 21 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 22 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 23 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 26 | ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; 27 | ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; }; 28 | 5A06A9B49B53437D82607854 /* DINAlternate-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E59C6475E7BC4C6AB8915D55 /* DINAlternate-Bold.ttf */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 35 | proxyType = 2; 36 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 37 | remoteInfo = RCTActionSheet; 38 | }; 39 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 42 | proxyType = 2; 43 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 44 | remoteInfo = RCTGeolocation; 45 | }; 46 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 47 | isa = PBXContainerItemProxy; 48 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 49 | proxyType = 2; 50 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 51 | remoteInfo = RCTImage; 52 | }; 53 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 54 | isa = PBXContainerItemProxy; 55 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 56 | proxyType = 2; 57 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 58 | remoteInfo = RCTNetwork; 59 | }; 60 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 61 | isa = PBXContainerItemProxy; 62 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 63 | proxyType = 2; 64 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 65 | remoteInfo = RCTVibration; 66 | }; 67 | 11BDCCC122776A2200487329 /* PBXContainerItemProxy */ = { 68 | isa = PBXContainerItemProxy; 69 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 70 | proxyType = 2; 71 | remoteGlobalIDString = EDEBC6D6214B3E7000DD5AC8; 72 | remoteInfo = jsi; 73 | }; 74 | 11BDCCC322776A2200487329 /* PBXContainerItemProxy */ = { 75 | isa = PBXContainerItemProxy; 76 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 77 | proxyType = 2; 78 | remoteGlobalIDString = EDEBC73B214B45A300DD5AC8; 79 | remoteInfo = jsiexecutor; 80 | }; 81 | 11BDCCC522776A2200487329 /* PBXContainerItemProxy */ = { 82 | isa = PBXContainerItemProxy; 83 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 84 | proxyType = 2; 85 | remoteGlobalIDString = ED296FB6214C9A0900B7C4FE; 86 | remoteInfo = "jsi-tvOS"; 87 | }; 88 | 11BDCCC722776A2200487329 /* PBXContainerItemProxy */ = { 89 | isa = PBXContainerItemProxy; 90 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 91 | proxyType = 2; 92 | remoteGlobalIDString = ED296FEE214C9CF800B7C4FE; 93 | remoteInfo = "jsiexecutor-tvOS"; 94 | }; 95 | 11BDCCCD22777C5300487329 /* PBXContainerItemProxy */ = { 96 | isa = PBXContainerItemProxy; 97 | containerPortal = 11BDCCC922777C5300487329 /* RNWindowGuard.xcodeproj */; 98 | proxyType = 2; 99 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 100 | remoteInfo = RNWindowGuard; 101 | }; 102 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 103 | isa = PBXContainerItemProxy; 104 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 105 | proxyType = 2; 106 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 107 | remoteInfo = RCTSettings; 108 | }; 109 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 110 | isa = PBXContainerItemProxy; 111 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 112 | proxyType = 2; 113 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 114 | remoteInfo = RCTWebSocket; 115 | }; 116 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 117 | isa = PBXContainerItemProxy; 118 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 119 | proxyType = 2; 120 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 121 | remoteInfo = React; 122 | }; 123 | 2D16E6711FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { 124 | isa = PBXContainerItemProxy; 125 | containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; 126 | proxyType = 2; 127 | remoteGlobalIDString = ADD01A681E09402E00F6D226; 128 | remoteInfo = "RCTBlob-tvOS"; 129 | }; 130 | 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { 131 | isa = PBXContainerItemProxy; 132 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 133 | proxyType = 2; 134 | remoteGlobalIDString = 3DBE0D001F3B181A0099AA32; 135 | remoteInfo = fishhook; 136 | }; 137 | 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { 138 | isa = PBXContainerItemProxy; 139 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 140 | proxyType = 2; 141 | remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32; 142 | remoteInfo = "fishhook-tvOS"; 143 | }; 144 | 2DF0FFDE2056DD460020B375 /* PBXContainerItemProxy */ = { 145 | isa = PBXContainerItemProxy; 146 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 147 | proxyType = 2; 148 | remoteGlobalIDString = EBF21BDC1FC498900052F4D5; 149 | remoteInfo = jsinspector; 150 | }; 151 | 2DF0FFE02056DD460020B375 /* PBXContainerItemProxy */ = { 152 | isa = PBXContainerItemProxy; 153 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 154 | proxyType = 2; 155 | remoteGlobalIDString = EBF21BFA1FC4989A0052F4D5; 156 | remoteInfo = "jsinspector-tvOS"; 157 | }; 158 | 2DF0FFE22056DD460020B375 /* PBXContainerItemProxy */ = { 159 | isa = PBXContainerItemProxy; 160 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 161 | proxyType = 2; 162 | remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7; 163 | remoteInfo = "third-party"; 164 | }; 165 | 2DF0FFE42056DD460020B375 /* PBXContainerItemProxy */ = { 166 | isa = PBXContainerItemProxy; 167 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 168 | proxyType = 2; 169 | remoteGlobalIDString = 3D383D3C1EBD27B6005632C8; 170 | remoteInfo = "third-party-tvOS"; 171 | }; 172 | 2DF0FFE62056DD460020B375 /* PBXContainerItemProxy */ = { 173 | isa = PBXContainerItemProxy; 174 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 175 | proxyType = 2; 176 | remoteGlobalIDString = 139D7E881E25C6D100323FB7; 177 | remoteInfo = "double-conversion"; 178 | }; 179 | 2DF0FFE82056DD460020B375 /* PBXContainerItemProxy */ = { 180 | isa = PBXContainerItemProxy; 181 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 182 | proxyType = 2; 183 | remoteGlobalIDString = 3D383D621EBD27B9005632C8; 184 | remoteInfo = "double-conversion-tvOS"; 185 | }; 186 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { 187 | isa = PBXContainerItemProxy; 188 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 189 | proxyType = 2; 190 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; 191 | remoteInfo = "RCTImage-tvOS"; 192 | }; 193 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { 194 | isa = PBXContainerItemProxy; 195 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 196 | proxyType = 2; 197 | remoteGlobalIDString = 2D2A28471D9B043800D4039D; 198 | remoteInfo = "RCTLinking-tvOS"; 199 | }; 200 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 201 | isa = PBXContainerItemProxy; 202 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 203 | proxyType = 2; 204 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D; 205 | remoteInfo = "RCTNetwork-tvOS"; 206 | }; 207 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 208 | isa = PBXContainerItemProxy; 209 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 210 | proxyType = 2; 211 | remoteGlobalIDString = 2D2A28611D9B046600D4039D; 212 | remoteInfo = "RCTSettings-tvOS"; 213 | }; 214 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { 215 | isa = PBXContainerItemProxy; 216 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 217 | proxyType = 2; 218 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D; 219 | remoteInfo = "RCTText-tvOS"; 220 | }; 221 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { 222 | isa = PBXContainerItemProxy; 223 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 224 | proxyType = 2; 225 | remoteGlobalIDString = 2D2A28881D9B049200D4039D; 226 | remoteInfo = "RCTWebSocket-tvOS"; 227 | }; 228 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { 229 | isa = PBXContainerItemProxy; 230 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 231 | proxyType = 2; 232 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D; 233 | remoteInfo = "React-tvOS"; 234 | }; 235 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { 236 | isa = PBXContainerItemProxy; 237 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 238 | proxyType = 2; 239 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA; 240 | remoteInfo = yoga; 241 | }; 242 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { 243 | isa = PBXContainerItemProxy; 244 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 245 | proxyType = 2; 246 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA; 247 | remoteInfo = "yoga-tvOS"; 248 | }; 249 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { 250 | isa = PBXContainerItemProxy; 251 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 252 | proxyType = 2; 253 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; 254 | remoteInfo = cxxreact; 255 | }; 256 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 257 | isa = PBXContainerItemProxy; 258 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 259 | proxyType = 2; 260 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; 261 | remoteInfo = "cxxreact-tvOS"; 262 | }; 263 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 264 | isa = PBXContainerItemProxy; 265 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 266 | proxyType = 2; 267 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 268 | remoteInfo = RCTAnimation; 269 | }; 270 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 271 | isa = PBXContainerItemProxy; 272 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 273 | proxyType = 2; 274 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 275 | remoteInfo = "RCTAnimation-tvOS"; 276 | }; 277 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 278 | isa = PBXContainerItemProxy; 279 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 280 | proxyType = 2; 281 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 282 | remoteInfo = RCTLinking; 283 | }; 284 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 285 | isa = PBXContainerItemProxy; 286 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 287 | proxyType = 2; 288 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 289 | remoteInfo = RCTText; 290 | }; 291 | ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */ = { 292 | isa = PBXContainerItemProxy; 293 | containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; 294 | proxyType = 2; 295 | remoteGlobalIDString = 358F4ED71D1E81A9004DF814; 296 | remoteInfo = RCTBlob; 297 | }; 298 | /* End PBXContainerItemProxy section */ 299 | 300 | /* Begin PBXFileReference section */ 301 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 302 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 303 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 304 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 305 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 306 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 307 | 11BDCCC922777C5300487329 /* RNWindowGuard.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNWindowGuard.xcodeproj; path = ../../ios/RNWindowGuard.xcodeproj; sourceTree = ""; }; 308 | 11BDCD6822781A7300487329 /* example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "example-Bridging-Header.h"; sourceTree = ""; }; 309 | 11BDCD6922781A7300487329 /* example.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = example.swift; sourceTree = ""; }; 310 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 311 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 312 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 313 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; 314 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; 315 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 316 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 317 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 318 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; 319 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 320 | 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 321 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 322 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 323 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 324 | ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; 325 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 326 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 327 | E59C6475E7BC4C6AB8915D55 /* DINAlternate-Bold.ttf */ = {isa = PBXFileReference; name = "DINAlternate-Bold.ttf"; path = "../assets/fonts/DINAlternate-Bold.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 328 | /* End PBXFileReference section */ 329 | 330 | /* Begin PBXFrameworksBuildPhase section */ 331 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 332 | isa = PBXFrameworksBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | 11BDCCDF22777F9B00487329 /* libRNWindowGuard.a in Frameworks */, 336 | ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */, 337 | ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, 338 | 11D1A2F320CAFA9E000508D9 /* libRCTAnimation.a in Frameworks */, 339 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 340 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 341 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 342 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 343 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 344 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 345 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 346 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 347 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 348 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 349 | ); 350 | runOnlyForDeploymentPostprocessing = 0; 351 | }; 352 | /* End PBXFrameworksBuildPhase section */ 353 | 354 | /* Begin PBXGroup section */ 355 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 356 | isa = PBXGroup; 357 | children = ( 358 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 359 | ); 360 | name = Products; 361 | sourceTree = ""; 362 | }; 363 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 364 | isa = PBXGroup; 365 | children = ( 366 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 367 | ); 368 | name = Products; 369 | sourceTree = ""; 370 | }; 371 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 372 | isa = PBXGroup; 373 | children = ( 374 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 375 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, 376 | ); 377 | name = Products; 378 | sourceTree = ""; 379 | }; 380 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 381 | isa = PBXGroup; 382 | children = ( 383 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 384 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, 385 | ); 386 | name = Products; 387 | sourceTree = ""; 388 | }; 389 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 390 | isa = PBXGroup; 391 | children = ( 392 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 393 | ); 394 | name = Products; 395 | sourceTree = ""; 396 | }; 397 | 11BDCC9B22776A2100487329 /* Recovered References */ = { 398 | isa = PBXGroup; 399 | children = ( 400 | ); 401 | name = "Recovered References"; 402 | sourceTree = ""; 403 | }; 404 | 11BDCCCA22777C5300487329 /* Products */ = { 405 | isa = PBXGroup; 406 | children = ( 407 | 11BDCCCE22777C5300487329 /* libRNWindowGuard.a */, 408 | ); 409 | name = Products; 410 | sourceTree = ""; 411 | }; 412 | 139105B71AF99BAD00B5F7CC /* Products */ = { 413 | isa = PBXGroup; 414 | children = ( 415 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 416 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, 417 | ); 418 | name = Products; 419 | sourceTree = ""; 420 | }; 421 | 139FDEE71B06529A00C62182 /* Products */ = { 422 | isa = PBXGroup; 423 | children = ( 424 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 425 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, 426 | 2D16E6841FA4F8DC00B85C8A /* libfishhook.a */, 427 | 2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */, 428 | ); 429 | name = Products; 430 | sourceTree = ""; 431 | }; 432 | 13B07FAE1A68108700A75B9A /* example */ = { 433 | isa = PBXGroup; 434 | children = ( 435 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 436 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 437 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 438 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 439 | 13B07FB61A68108700A75B9A /* Info.plist */, 440 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 441 | 13B07FB71A68108700A75B9A /* main.m */, 442 | 11BDCD6922781A7300487329 /* example.swift */, 443 | 11BDCD6822781A7300487329 /* example-Bridging-Header.h */, 444 | ); 445 | name = example; 446 | sourceTree = ""; 447 | }; 448 | 146834001AC3E56700842450 /* Products */ = { 449 | isa = PBXGroup; 450 | children = ( 451 | 146834041AC3E56700842450 /* libReact.a */, 452 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */, 453 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 454 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 455 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, 456 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 457 | 2DF0FFDF2056DD460020B375 /* libjsinspector.a */, 458 | 2DF0FFE12056DD460020B375 /* libjsinspector-tvOS.a */, 459 | 2DF0FFE32056DD460020B375 /* libthird-party.a */, 460 | 2DF0FFE52056DD460020B375 /* libthird-party.a */, 461 | 2DF0FFE72056DD460020B375 /* libdouble-conversion.a */, 462 | 2DF0FFE92056DD460020B375 /* libdouble-conversion.a */, 463 | 11BDCCC222776A2200487329 /* libjsi.a */, 464 | 11BDCCC422776A2200487329 /* libjsiexecutor.a */, 465 | 11BDCCC622776A2200487329 /* libjsi-tvOS.a */, 466 | 11BDCCC822776A2200487329 /* libjsiexecutor-tvOS.a */, 467 | ); 468 | name = Products; 469 | sourceTree = ""; 470 | }; 471 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 472 | isa = PBXGroup; 473 | children = ( 474 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 475 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 476 | 2D16E6891FA4F8E400B85C8A /* libReact.a */, 477 | ); 478 | name = Frameworks; 479 | sourceTree = ""; 480 | }; 481 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 482 | isa = PBXGroup; 483 | children = ( 484 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 485 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */, 486 | ); 487 | name = Products; 488 | sourceTree = ""; 489 | }; 490 | 78C398B11ACF4ADC00677621 /* Products */ = { 491 | isa = PBXGroup; 492 | children = ( 493 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 494 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, 495 | ); 496 | name = Products; 497 | sourceTree = ""; 498 | }; 499 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 500 | isa = PBXGroup; 501 | children = ( 502 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 503 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 504 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 505 | ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */, 506 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 507 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 508 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 509 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 510 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 511 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 512 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 513 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 514 | 11BDCCC922777C5300487329 /* RNWindowGuard.xcodeproj */, 515 | ); 516 | name = Libraries; 517 | sourceTree = ""; 518 | }; 519 | 832341B11AAA6A8300B99B32 /* Products */ = { 520 | isa = PBXGroup; 521 | children = ( 522 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 523 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, 524 | ); 525 | name = Products; 526 | sourceTree = ""; 527 | }; 528 | 83CBB9F61A601CBA00E9B192 = { 529 | isa = PBXGroup; 530 | children = ( 531 | 13B07FAE1A68108700A75B9A /* example */, 532 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 533 | 83CBBA001A601CBA00E9B192 /* Products */, 534 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 535 | 11BDCC9B22776A2100487329 /* Recovered References */, 536 | 41C1F22F1CDC40E3A1712F0B /* Resources */, 537 | ); 538 | indentWidth = 2; 539 | sourceTree = ""; 540 | tabWidth = 2; 541 | usesTabs = 0; 542 | }; 543 | 83CBBA001A601CBA00E9B192 /* Products */ = { 544 | isa = PBXGroup; 545 | children = ( 546 | 13B07F961A680F5B00A75B9A /* example.app */, 547 | ); 548 | name = Products; 549 | sourceTree = ""; 550 | }; 551 | ADBDB9201DFEBF0600ED6528 /* Products */ = { 552 | isa = PBXGroup; 553 | children = ( 554 | ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */, 555 | 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */, 556 | ); 557 | name = Products; 558 | sourceTree = ""; 559 | }; 560 | 41C1F22F1CDC40E3A1712F0B /* Resources */ = { 561 | isa = "PBXGroup"; 562 | children = ( 563 | E59C6475E7BC4C6AB8915D55 /* DINAlternate-Bold.ttf */, 564 | ); 565 | name = Resources; 566 | sourceTree = ""; 567 | path = ""; 568 | }; 569 | /* End PBXGroup section */ 570 | 571 | /* Begin PBXNativeTarget section */ 572 | 13B07F861A680F5B00A75B9A /* example */ = { 573 | isa = PBXNativeTarget; 574 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 575 | buildPhases = ( 576 | 13B07F871A680F5B00A75B9A /* Sources */, 577 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 578 | 13B07F8E1A680F5B00A75B9A /* Resources */, 579 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 580 | ); 581 | buildRules = ( 582 | ); 583 | dependencies = ( 584 | ); 585 | name = example; 586 | productName = "Hello World"; 587 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 588 | productType = "com.apple.product-type.application"; 589 | }; 590 | /* End PBXNativeTarget section */ 591 | 592 | /* Begin PBXProject section */ 593 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 594 | isa = PBXProject; 595 | attributes = { 596 | LastUpgradeCheck = 940; 597 | ORGANIZATIONNAME = Facebook; 598 | TargetAttributes = { 599 | 13B07F861A680F5B00A75B9A = { 600 | LastSwiftMigration = 1010; 601 | }; 602 | }; 603 | }; 604 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 605 | compatibilityVersion = "Xcode 3.2"; 606 | developmentRegion = English; 607 | hasScannedForEncodings = 0; 608 | knownRegions = ( 609 | en, 610 | Base, 611 | ); 612 | mainGroup = 83CBB9F61A601CBA00E9B192; 613 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 614 | projectDirPath = ""; 615 | projectReferences = ( 616 | { 617 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 618 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 619 | }, 620 | { 621 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 622 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 623 | }, 624 | { 625 | ProductGroup = ADBDB9201DFEBF0600ED6528 /* Products */; 626 | ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; 627 | }, 628 | { 629 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 630 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 631 | }, 632 | { 633 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 634 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 635 | }, 636 | { 637 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 638 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 639 | }, 640 | { 641 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 642 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 643 | }, 644 | { 645 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 646 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 647 | }, 648 | { 649 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 650 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 651 | }, 652 | { 653 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 654 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 655 | }, 656 | { 657 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 658 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 659 | }, 660 | { 661 | ProductGroup = 146834001AC3E56700842450 /* Products */; 662 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 663 | }, 664 | { 665 | ProductGroup = 11BDCCCA22777C5300487329 /* Products */; 666 | ProjectRef = 11BDCCC922777C5300487329 /* RNWindowGuard.xcodeproj */; 667 | }, 668 | ); 669 | projectRoot = ""; 670 | targets = ( 671 | 13B07F861A680F5B00A75B9A /* example */, 672 | ); 673 | }; 674 | /* End PBXProject section */ 675 | 676 | /* Begin PBXReferenceProxy section */ 677 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 678 | isa = PBXReferenceProxy; 679 | fileType = archive.ar; 680 | path = libRCTActionSheet.a; 681 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 682 | sourceTree = BUILT_PRODUCTS_DIR; 683 | }; 684 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 685 | isa = PBXReferenceProxy; 686 | fileType = archive.ar; 687 | path = libRCTGeolocation.a; 688 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 689 | sourceTree = BUILT_PRODUCTS_DIR; 690 | }; 691 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 692 | isa = PBXReferenceProxy; 693 | fileType = archive.ar; 694 | path = libRCTImage.a; 695 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 696 | sourceTree = BUILT_PRODUCTS_DIR; 697 | }; 698 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 699 | isa = PBXReferenceProxy; 700 | fileType = archive.ar; 701 | path = libRCTNetwork.a; 702 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 703 | sourceTree = BUILT_PRODUCTS_DIR; 704 | }; 705 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 706 | isa = PBXReferenceProxy; 707 | fileType = archive.ar; 708 | path = libRCTVibration.a; 709 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 710 | sourceTree = BUILT_PRODUCTS_DIR; 711 | }; 712 | 11BDCCC222776A2200487329 /* libjsi.a */ = { 713 | isa = PBXReferenceProxy; 714 | fileType = archive.ar; 715 | path = libjsi.a; 716 | remoteRef = 11BDCCC122776A2200487329 /* PBXContainerItemProxy */; 717 | sourceTree = BUILT_PRODUCTS_DIR; 718 | }; 719 | 11BDCCC422776A2200487329 /* libjsiexecutor.a */ = { 720 | isa = PBXReferenceProxy; 721 | fileType = archive.ar; 722 | path = libjsiexecutor.a; 723 | remoteRef = 11BDCCC322776A2200487329 /* PBXContainerItemProxy */; 724 | sourceTree = BUILT_PRODUCTS_DIR; 725 | }; 726 | 11BDCCC622776A2200487329 /* libjsi-tvOS.a */ = { 727 | isa = PBXReferenceProxy; 728 | fileType = archive.ar; 729 | path = "libjsi-tvOS.a"; 730 | remoteRef = 11BDCCC522776A2200487329 /* PBXContainerItemProxy */; 731 | sourceTree = BUILT_PRODUCTS_DIR; 732 | }; 733 | 11BDCCC822776A2200487329 /* libjsiexecutor-tvOS.a */ = { 734 | isa = PBXReferenceProxy; 735 | fileType = archive.ar; 736 | path = "libjsiexecutor-tvOS.a"; 737 | remoteRef = 11BDCCC722776A2200487329 /* PBXContainerItemProxy */; 738 | sourceTree = BUILT_PRODUCTS_DIR; 739 | }; 740 | 11BDCCCE22777C5300487329 /* libRNWindowGuard.a */ = { 741 | isa = PBXReferenceProxy; 742 | fileType = archive.ar; 743 | path = libRNWindowGuard.a; 744 | remoteRef = 11BDCCCD22777C5300487329 /* PBXContainerItemProxy */; 745 | sourceTree = BUILT_PRODUCTS_DIR; 746 | }; 747 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 748 | isa = PBXReferenceProxy; 749 | fileType = archive.ar; 750 | path = libRCTSettings.a; 751 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 752 | sourceTree = BUILT_PRODUCTS_DIR; 753 | }; 754 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 755 | isa = PBXReferenceProxy; 756 | fileType = archive.ar; 757 | path = libRCTWebSocket.a; 758 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 759 | sourceTree = BUILT_PRODUCTS_DIR; 760 | }; 761 | 146834041AC3E56700842450 /* libReact.a */ = { 762 | isa = PBXReferenceProxy; 763 | fileType = archive.ar; 764 | path = libReact.a; 765 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 766 | sourceTree = BUILT_PRODUCTS_DIR; 767 | }; 768 | 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = { 769 | isa = PBXReferenceProxy; 770 | fileType = archive.ar; 771 | path = "libRCTBlob-tvOS.a"; 772 | remoteRef = 2D16E6711FA4F8DC00B85C8A /* PBXContainerItemProxy */; 773 | sourceTree = BUILT_PRODUCTS_DIR; 774 | }; 775 | 2D16E6841FA4F8DC00B85C8A /* libfishhook.a */ = { 776 | isa = PBXReferenceProxy; 777 | fileType = archive.ar; 778 | path = libfishhook.a; 779 | remoteRef = 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */; 780 | sourceTree = BUILT_PRODUCTS_DIR; 781 | }; 782 | 2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */ = { 783 | isa = PBXReferenceProxy; 784 | fileType = archive.ar; 785 | path = "libfishhook-tvOS.a"; 786 | remoteRef = 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */; 787 | sourceTree = BUILT_PRODUCTS_DIR; 788 | }; 789 | 2DF0FFDF2056DD460020B375 /* libjsinspector.a */ = { 790 | isa = PBXReferenceProxy; 791 | fileType = archive.ar; 792 | path = libjsinspector.a; 793 | remoteRef = 2DF0FFDE2056DD460020B375 /* PBXContainerItemProxy */; 794 | sourceTree = BUILT_PRODUCTS_DIR; 795 | }; 796 | 2DF0FFE12056DD460020B375 /* libjsinspector-tvOS.a */ = { 797 | isa = PBXReferenceProxy; 798 | fileType = archive.ar; 799 | path = "libjsinspector-tvOS.a"; 800 | remoteRef = 2DF0FFE02056DD460020B375 /* PBXContainerItemProxy */; 801 | sourceTree = BUILT_PRODUCTS_DIR; 802 | }; 803 | 2DF0FFE32056DD460020B375 /* libthird-party.a */ = { 804 | isa = PBXReferenceProxy; 805 | fileType = archive.ar; 806 | path = "libthird-party.a"; 807 | remoteRef = 2DF0FFE22056DD460020B375 /* PBXContainerItemProxy */; 808 | sourceTree = BUILT_PRODUCTS_DIR; 809 | }; 810 | 2DF0FFE52056DD460020B375 /* libthird-party.a */ = { 811 | isa = PBXReferenceProxy; 812 | fileType = archive.ar; 813 | path = "libthird-party.a"; 814 | remoteRef = 2DF0FFE42056DD460020B375 /* PBXContainerItemProxy */; 815 | sourceTree = BUILT_PRODUCTS_DIR; 816 | }; 817 | 2DF0FFE72056DD460020B375 /* libdouble-conversion.a */ = { 818 | isa = PBXReferenceProxy; 819 | fileType = archive.ar; 820 | path = "libdouble-conversion.a"; 821 | remoteRef = 2DF0FFE62056DD460020B375 /* PBXContainerItemProxy */; 822 | sourceTree = BUILT_PRODUCTS_DIR; 823 | }; 824 | 2DF0FFE92056DD460020B375 /* libdouble-conversion.a */ = { 825 | isa = PBXReferenceProxy; 826 | fileType = archive.ar; 827 | path = "libdouble-conversion.a"; 828 | remoteRef = 2DF0FFE82056DD460020B375 /* PBXContainerItemProxy */; 829 | sourceTree = BUILT_PRODUCTS_DIR; 830 | }; 831 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { 832 | isa = PBXReferenceProxy; 833 | fileType = archive.ar; 834 | path = "libRCTImage-tvOS.a"; 835 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; 836 | sourceTree = BUILT_PRODUCTS_DIR; 837 | }; 838 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { 839 | isa = PBXReferenceProxy; 840 | fileType = archive.ar; 841 | path = "libRCTLinking-tvOS.a"; 842 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; 843 | sourceTree = BUILT_PRODUCTS_DIR; 844 | }; 845 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { 846 | isa = PBXReferenceProxy; 847 | fileType = archive.ar; 848 | path = "libRCTNetwork-tvOS.a"; 849 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; 850 | sourceTree = BUILT_PRODUCTS_DIR; 851 | }; 852 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { 853 | isa = PBXReferenceProxy; 854 | fileType = archive.ar; 855 | path = "libRCTSettings-tvOS.a"; 856 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; 857 | sourceTree = BUILT_PRODUCTS_DIR; 858 | }; 859 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { 860 | isa = PBXReferenceProxy; 861 | fileType = archive.ar; 862 | path = "libRCTText-tvOS.a"; 863 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; 864 | sourceTree = BUILT_PRODUCTS_DIR; 865 | }; 866 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { 867 | isa = PBXReferenceProxy; 868 | fileType = archive.ar; 869 | path = "libRCTWebSocket-tvOS.a"; 870 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; 871 | sourceTree = BUILT_PRODUCTS_DIR; 872 | }; 873 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */ = { 874 | isa = PBXReferenceProxy; 875 | fileType = archive.ar; 876 | path = libReact.a; 877 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; 878 | sourceTree = BUILT_PRODUCTS_DIR; 879 | }; 880 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { 881 | isa = PBXReferenceProxy; 882 | fileType = archive.ar; 883 | path = libyoga.a; 884 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; 885 | sourceTree = BUILT_PRODUCTS_DIR; 886 | }; 887 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { 888 | isa = PBXReferenceProxy; 889 | fileType = archive.ar; 890 | path = libyoga.a; 891 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; 892 | sourceTree = BUILT_PRODUCTS_DIR; 893 | }; 894 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { 895 | isa = PBXReferenceProxy; 896 | fileType = archive.ar; 897 | path = libcxxreact.a; 898 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; 899 | sourceTree = BUILT_PRODUCTS_DIR; 900 | }; 901 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { 902 | isa = PBXReferenceProxy; 903 | fileType = archive.ar; 904 | path = libcxxreact.a; 905 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; 906 | sourceTree = BUILT_PRODUCTS_DIR; 907 | }; 908 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 909 | isa = PBXReferenceProxy; 910 | fileType = archive.ar; 911 | path = libRCTAnimation.a; 912 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 913 | sourceTree = BUILT_PRODUCTS_DIR; 914 | }; 915 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 916 | isa = PBXReferenceProxy; 917 | fileType = archive.ar; 918 | path = libRCTAnimation.a; 919 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 920 | sourceTree = BUILT_PRODUCTS_DIR; 921 | }; 922 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 923 | isa = PBXReferenceProxy; 924 | fileType = archive.ar; 925 | path = libRCTLinking.a; 926 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 927 | sourceTree = BUILT_PRODUCTS_DIR; 928 | }; 929 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 930 | isa = PBXReferenceProxy; 931 | fileType = archive.ar; 932 | path = libRCTText.a; 933 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 934 | sourceTree = BUILT_PRODUCTS_DIR; 935 | }; 936 | ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */ = { 937 | isa = PBXReferenceProxy; 938 | fileType = archive.ar; 939 | path = libRCTBlob.a; 940 | remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */; 941 | sourceTree = BUILT_PRODUCTS_DIR; 942 | }; 943 | /* End PBXReferenceProxy section */ 944 | 945 | /* Begin PBXResourcesBuildPhase section */ 946 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 947 | isa = PBXResourcesBuildPhase; 948 | buildActionMask = 2147483647; 949 | files = ( 950 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 951 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 952 | 5A06A9B49B53437D82607854 /* DINAlternate-Bold.ttf in Resources */, 953 | ); 954 | runOnlyForDeploymentPostprocessing = 0; 955 | }; 956 | /* End PBXResourcesBuildPhase section */ 957 | 958 | /* Begin PBXShellScriptBuildPhase section */ 959 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 960 | isa = PBXShellScriptBuildPhase; 961 | buildActionMask = 2147483647; 962 | files = ( 963 | ); 964 | inputPaths = ( 965 | ); 966 | name = "Bundle React Native code and images"; 967 | outputPaths = ( 968 | ); 969 | runOnlyForDeploymentPostprocessing = 0; 970 | shellPath = /bin/sh; 971 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 972 | }; 973 | /* End PBXShellScriptBuildPhase section */ 974 | 975 | /* Begin PBXSourcesBuildPhase section */ 976 | 13B07F871A680F5B00A75B9A /* Sources */ = { 977 | isa = PBXSourcesBuildPhase; 978 | buildActionMask = 2147483647; 979 | files = ( 980 | 11BDCD6A22781A7300487329 /* example.swift in Sources */, 981 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 982 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 983 | ); 984 | runOnlyForDeploymentPostprocessing = 0; 985 | }; 986 | /* End PBXSourcesBuildPhase section */ 987 | 988 | /* Begin PBXVariantGroup section */ 989 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 990 | isa = PBXVariantGroup; 991 | children = ( 992 | 13B07FB21A68108700A75B9A /* Base */, 993 | ); 994 | name = LaunchScreen.xib; 995 | path = example; 996 | sourceTree = ""; 997 | }; 998 | /* End PBXVariantGroup section */ 999 | 1000 | /* Begin XCBuildConfiguration section */ 1001 | 13B07F941A680F5B00A75B9A /* Debug */ = { 1002 | isa = XCBuildConfiguration; 1003 | buildSettings = { 1004 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1005 | CLANG_ENABLE_MODULES = YES; 1006 | CURRENT_PROJECT_VERSION = 1; 1007 | DEAD_CODE_STRIPPING = NO; 1008 | HEADER_SEARCH_PATHS = ( 1009 | "$(inherited)", 1010 | "$(SRCROOT)/../node_modules/react-native-test/ios", 1011 | ); 1012 | INFOPLIST_FILE = example/Info.plist; 1013 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1014 | OTHER_LDFLAGS = ( 1015 | "$(inherited)", 1016 | "-ObjC", 1017 | "-lc++", 1018 | ); 1019 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 1020 | PRODUCT_NAME = example; 1021 | SWIFT_OBJC_BRIDGING_HEADER = "example-Bridging-Header.h"; 1022 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1023 | SWIFT_VERSION = 4.2; 1024 | VERSIONING_SYSTEM = "apple-generic"; 1025 | }; 1026 | name = Debug; 1027 | }; 1028 | 13B07F951A680F5B00A75B9A /* Release */ = { 1029 | isa = XCBuildConfiguration; 1030 | buildSettings = { 1031 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 1032 | CLANG_ENABLE_MODULES = YES; 1033 | CURRENT_PROJECT_VERSION = 1; 1034 | HEADER_SEARCH_PATHS = ( 1035 | "$(inherited)", 1036 | "$(SRCROOT)/../node_modules/react-native-test/ios", 1037 | ); 1038 | INFOPLIST_FILE = example/Info.plist; 1039 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 1040 | OTHER_LDFLAGS = ( 1041 | "$(inherited)", 1042 | "-ObjC", 1043 | "-lc++", 1044 | ); 1045 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 1046 | PRODUCT_NAME = example; 1047 | SWIFT_OBJC_BRIDGING_HEADER = "example-Bridging-Header.h"; 1048 | SWIFT_VERSION = 4.2; 1049 | VERSIONING_SYSTEM = "apple-generic"; 1050 | }; 1051 | name = Release; 1052 | }; 1053 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 1054 | isa = XCBuildConfiguration; 1055 | buildSettings = { 1056 | ALWAYS_SEARCH_USER_PATHS = NO; 1057 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1058 | CLANG_CXX_LIBRARY = "libc++"; 1059 | CLANG_ENABLE_MODULES = YES; 1060 | CLANG_ENABLE_OBJC_ARC = YES; 1061 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1062 | CLANG_WARN_BOOL_CONVERSION = YES; 1063 | CLANG_WARN_COMMA = YES; 1064 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1065 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1066 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1067 | CLANG_WARN_EMPTY_BODY = YES; 1068 | CLANG_WARN_ENUM_CONVERSION = YES; 1069 | CLANG_WARN_INFINITE_RECURSION = YES; 1070 | CLANG_WARN_INT_CONVERSION = YES; 1071 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1072 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1073 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1074 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1075 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1076 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1077 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1078 | CLANG_WARN_UNREACHABLE_CODE = YES; 1079 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1080 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1081 | COPY_PHASE_STRIP = NO; 1082 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1083 | ENABLE_TESTABILITY = YES; 1084 | GCC_C_LANGUAGE_STANDARD = gnu99; 1085 | GCC_DYNAMIC_NO_PIC = NO; 1086 | GCC_NO_COMMON_BLOCKS = YES; 1087 | GCC_OPTIMIZATION_LEVEL = 0; 1088 | GCC_PREPROCESSOR_DEFINITIONS = ( 1089 | "DEBUG=1", 1090 | "$(inherited)", 1091 | ); 1092 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 1093 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1094 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1095 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1096 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1097 | GCC_WARN_UNUSED_FUNCTION = YES; 1098 | GCC_WARN_UNUSED_VARIABLE = YES; 1099 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 1100 | MTL_ENABLE_DEBUG_INFO = YES; 1101 | ONLY_ACTIVE_ARCH = YES; 1102 | SDKROOT = iphoneos; 1103 | }; 1104 | name = Debug; 1105 | }; 1106 | 83CBBA211A601CBA00E9B192 /* Release */ = { 1107 | isa = XCBuildConfiguration; 1108 | buildSettings = { 1109 | ALWAYS_SEARCH_USER_PATHS = NO; 1110 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 1111 | CLANG_CXX_LIBRARY = "libc++"; 1112 | CLANG_ENABLE_MODULES = YES; 1113 | CLANG_ENABLE_OBJC_ARC = YES; 1114 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 1115 | CLANG_WARN_BOOL_CONVERSION = YES; 1116 | CLANG_WARN_COMMA = YES; 1117 | CLANG_WARN_CONSTANT_CONVERSION = YES; 1118 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 1119 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 1120 | CLANG_WARN_EMPTY_BODY = YES; 1121 | CLANG_WARN_ENUM_CONVERSION = YES; 1122 | CLANG_WARN_INFINITE_RECURSION = YES; 1123 | CLANG_WARN_INT_CONVERSION = YES; 1124 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 1125 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 1126 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 1127 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 1128 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 1129 | CLANG_WARN_STRICT_PROTOTYPES = YES; 1130 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 1131 | CLANG_WARN_UNREACHABLE_CODE = YES; 1132 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 1133 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 1134 | COPY_PHASE_STRIP = YES; 1135 | ENABLE_NS_ASSERTIONS = NO; 1136 | ENABLE_STRICT_OBJC_MSGSEND = YES; 1137 | GCC_C_LANGUAGE_STANDARD = gnu99; 1138 | GCC_NO_COMMON_BLOCKS = YES; 1139 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 1140 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 1141 | GCC_WARN_UNDECLARED_SELECTOR = YES; 1142 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 1143 | GCC_WARN_UNUSED_FUNCTION = YES; 1144 | GCC_WARN_UNUSED_VARIABLE = YES; 1145 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 1146 | MTL_ENABLE_DEBUG_INFO = NO; 1147 | SDKROOT = iphoneos; 1148 | VALIDATE_PRODUCT = YES; 1149 | }; 1150 | name = Release; 1151 | }; 1152 | /* End XCBuildConfiguration section */ 1153 | 1154 | /* Begin XCConfigurationList section */ 1155 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 1156 | isa = XCConfigurationList; 1157 | buildConfigurations = ( 1158 | 13B07F941A680F5B00A75B9A /* Debug */, 1159 | 13B07F951A680F5B00A75B9A /* Release */, 1160 | ); 1161 | defaultConfigurationIsVisible = 0; 1162 | defaultConfigurationName = Release; 1163 | }; 1164 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 1165 | isa = XCConfigurationList; 1166 | buildConfigurations = ( 1167 | 83CBBA201A601CBA00E9B192 /* Debug */, 1168 | 83CBBA211A601CBA00E9B192 /* Release */, 1169 | ); 1170 | defaultConfigurationIsVisible = 0; 1171 | defaultConfigurationName = Release; 1172 | }; 1173 | /* End XCConfigurationList section */ 1174 | }; 1175 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1176 | } 1177 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 20 | moduleName:@"example" 21 | initialProperties:nil]; 22 | 23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:0.647f green:0.854f blue:0.2039f alpha:1]; 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 26 | UIViewController *rootViewController = [UIViewController new]; 27 | rootViewController.view = rootView; 28 | self.window.rootViewController = rootViewController; 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 34 | { 35 | #if DEBUG 36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 37 | #else 38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 39 | #endif 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /example/ios/example/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 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 | NSLocationWhenInUseUsageDescription 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | NSAppTransportSecurity 44 | 45 | NSAllowsArbitraryLoads 46 | 47 | NSExceptionDomains 48 | 49 | localhost 50 | 51 | NSExceptionAllowsInsecureHTTPLoads 52 | 53 | 54 | 55 | 56 | UIAppFonts 57 | 58 | DINAlternate-Bold.ttf 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/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: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest", 8 | "postinstall": "node ../scripts/examples_postinstall.js node_modules/react-native-test" 9 | }, 10 | "dependencies": { 11 | "react": "16.8.3", 12 | "react-native": "0.59.5", 13 | "react-native-window-guard": "file:../" 14 | }, 15 | "devDependencies": { 16 | "@babel/core": "^7.4.3", 17 | "@babel/runtime": "^7.4.3", 18 | "babel-jest": "^24.7.1", 19 | "jest": "^24.7.1", 20 | "metro-react-native-babel-preset": "^0.53.1", 21 | "react-test-renderer": "16.8.3" 22 | }, 23 | "rnpm": { 24 | "assets": [ 25 | "./assets/fonts/" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /example/snapshot_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/snapshot_android.png -------------------------------------------------------------------------------- /example/snapshot_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/greenfrvr/react-native-window-guard/baabde4171926f616a07a1eecf587a736f811b39/example/snapshot_ios.png -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import {ViewProps} from 'react-native'; 3 | 4 | declare class Insets { 5 | leftInset: number; 6 | topInset: number; 7 | rightInset: number; 8 | bottomInset: number; 9 | } 10 | 11 | export interface WindowGuardProps extends ViewProps { 12 | applyInsets: string[] 13 | onInsetsChange?: (insets: Insets, notch: boolean) => void 14 | } 15 | 16 | export default class WindowGuard extends React.Component { 17 | static bottom: string[]; 18 | static left: string[]; 19 | static right: string[]; 20 | static top: string[]; 21 | static horizontal: string[]; 22 | static vertical: string[]; 23 | static all: string[]; 24 | 25 | adjustInsets(): void 26 | } 27 | 28 | export function withWindowGuard(component: React.ReactNode, insetsConfig: string[]): React.Component; 29 | 30 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | View, 4 | StyleSheet, 5 | NativeModules, 6 | } from 'react-native'; 7 | 8 | export const { RNWindowGuard } = NativeModules; 9 | 10 | const Orientation = Object.freeze({ 11 | 'vertical': 1, 12 | 'horizontal': 2 13 | }); 14 | const WindowSides = Object.freeze([ 15 | { 16 | key: 'left', 17 | insetKey: 'leftInset', 18 | attrKey: 'paddingLeft' 19 | }, 20 | { 21 | key: 'right', 22 | insetKey: 'rightInset', 23 | attrKey: 'paddingRight' 24 | }, 25 | { 26 | key: 'top', 27 | insetKey: 'topInset', 28 | attrKey: 'paddingTop' 29 | }, 30 | { 31 | key: 'bottom', 32 | insetKey: 'bottomInset', 33 | attrKey: 'paddingBottom' 34 | } 35 | ]); 36 | const WindowSidesConfig = Object.freeze({ 37 | 'left': ['left'], 38 | 'right': ['right'], 39 | 'top': ['top'], 40 | 'bottom': ['bottom'], 41 | 'horizontal': ['left', 'right'], 42 | 'vertical': ['top', 'bottom'], 43 | 'all': ['left', 'top', 'right', 'bottom'], 44 | }); 45 | 46 | class WindowGuard extends React.PureComponent { 47 | 48 | static get left() { 49 | return WindowSidesConfig.left; 50 | } 51 | 52 | static get right() { 53 | return WindowSidesConfig.right; 54 | } 55 | 56 | static get top() { 57 | return WindowSidesConfig.top; 58 | } 59 | 60 | static get bottom() { 61 | return WindowSidesConfig.bottom; 62 | } 63 | 64 | static get horizontal() { 65 | return WindowSidesConfig.horizontal; 66 | } 67 | 68 | static get vertical() { 69 | return WindowSidesConfig.vertical; 70 | } 71 | 72 | static get all() { 73 | return WindowSidesConfig.all; 74 | } 75 | 76 | constructor(props) { 77 | super(props); 78 | 79 | this.state = this.initialState(); 80 | 81 | this.adjustInsets(); 82 | } 83 | 84 | initialState() { 85 | const { 86 | leftInset = 0, 87 | topInset = 0, 88 | rightInset = 0, 89 | bottomInset = 0 90 | } = WindowGuard.insets || {}; 91 | 92 | return { 93 | leftInset, 94 | topInset, 95 | rightInset, 96 | bottomInset, 97 | orientation: Orientation.vertical 98 | }; 99 | } 100 | 101 | adjustInsets() { 102 | RNWindowGuard.requestWindowInsets() 103 | .then(windowInsets => { 104 | const { hasNotch, ...insets } = windowInsets; 105 | WindowGuard.hasNotch = hasNotch; 106 | WindowGuard.insets = insets; //need some more smart caching 107 | 108 | this.setState(insets, () => { 109 | this.props.onInsetsChange && this.props.onInsetsChange(insets, hasNotch); 110 | }); 111 | }); 112 | } 113 | 114 | onLayout = (e) => { 115 | const { width, height } = e.nativeEvent.layout; 116 | const orientation = width > height ? Orientation.horizontal : Orientation.vertical; 117 | if (orientation !== this.state.orientation) { 118 | this.setState({ orientation }, () => this.adjustInsets()); 119 | } 120 | 121 | this.props.onLayout && this.props.onLayout(e); 122 | }; 123 | 124 | rearrangeStyle = (style) => { 125 | if (style.hasOwnProperty('padding')) { 126 | style.paddingTop = style.padding; 127 | style.paddingBottom = style.padding; 128 | style.paddingLeft = style.padding; 129 | style.paddingRight = style.padding; 130 | delete style.padding; 131 | } 132 | 133 | if (style.hasOwnProperty('paddingVertical')) { 134 | style.paddingTop = style.paddingVertical; 135 | style.paddingBottom = style.paddingVertical; 136 | delete style.paddingVertical; 137 | } 138 | 139 | if (style.hasOwnProperty('paddingHorizontal')) { 140 | style.paddingLeft = style.paddingHorizontal; 141 | style.paddingRight = style.paddingHorizontal; 142 | delete style.paddingHorizontal; 143 | } 144 | return style; 145 | }; 146 | 147 | defineStyle = (s) => { 148 | const { applyInsets } = this.props; 149 | const style = this.rearrangeStyle(s); 150 | const sizeStyle = {}; 151 | 152 | if (applyInsets) { 153 | WindowSides.forEach(insetConfig => { 154 | const { key, attrKey, insetKey } = insetConfig; 155 | sizeStyle[attrKey] = (applyInsets.includes(key) && this.state[insetKey]) || 0; 156 | sizeStyle[attrKey] += style[attrKey] || 0; //here we apply padding from user defined style 157 | }); 158 | 159 | if (style.height && typeof style.height === 'number') { 160 | sizeStyle.height = style.height + sizeStyle.paddingTop + sizeStyle.paddingBottom; 161 | } 162 | 163 | if (style.width && typeof style.width === 'number') { 164 | sizeStyle.width = style.width + sizeStyle.paddingLeft + sizeStyle.paddingRight; 165 | } 166 | } 167 | 168 | return Object.assign({}, style, sizeStyle); 169 | }; 170 | 171 | render() { 172 | const { style, ...props } = this.props; 173 | const adjustedStyle = this.defineStyle(StyleSheet.flatten(style || {})); 174 | return ( 175 | //perhaps it also makes sense to check if view touches display boundaries before applying padding (just as it is implemented in SafeAreaView) 176 | 177 | ); 178 | } 179 | } 180 | 181 | //hasNotch can't be changed during runtime, so this method can be useful to know if device has notch 182 | WindowGuard.requestWindowInsets = () => { 183 | RNWindowGuard.requestWindowInsets() 184 | .then(windowInsets => { 185 | const { hasNotch, ...insets } = windowInsets; 186 | WindowGuard.hasNotch = hasNotch; 187 | WindowGuard.insets = insets; 188 | }); 189 | }; 190 | 191 | export function withWindowGuard(WrappedComponent, inset = WindowGuard.top) { 192 | return class extends React.PureComponent { 193 | 194 | constructor(props) { 195 | super(props); 196 | this.ref = React.createRef(); 197 | } 198 | 199 | adjustInsets = () => { 200 | this.ref.current.adjustInsets && this.ref.current.adjustInsets(); 201 | }; 202 | 203 | render() { 204 | const { 205 | guardStyle, 206 | ...props 207 | } = this.props; 208 | 209 | return ( 210 | 214 | 215 | 216 | ); 217 | } 218 | }; 219 | } 220 | 221 | const styles = StyleSheet.create({ 222 | container: { 223 | flex: 1 224 | } 225 | }); 226 | 227 | export default WindowGuard; 228 | -------------------------------------------------------------------------------- /ios/RNWindowGuard-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | -------------------------------------------------------------------------------- /ios/RNWindowGuard.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RCT_EXTERN_MODULE(RNWindowGuard, NSObject) 4 | 5 | RCT_EXTERN_METHOD(requestWindowInsets: (RCTPromiseResolveBlock)resolve rejecter: (RCTPromiseRejectBlock)reject) 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /ios/RNWindowGuard.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | @objc(RNWindowGuard) 4 | public class RNWindowGuard: NSObject { 5 | 6 | @objc static func requiresMainQueueSetup() -> Bool { 7 | return true 8 | } 9 | 10 | @objc 11 | func requestWindowInsets(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void { 12 | if let insets = extractInsets() { 13 | resolve(insets) 14 | } 15 | } 16 | 17 | private func extractInsets() -> [String: Any]? { 18 | var insets: [String: Any]? = nil 19 | DispatchQueue.main.sync { 20 | if #available(iOS 11.0, *) { 21 | if let window = UIApplication.shared.keyWindow, !window.safeAreaInsets.isZero { 22 | insets = self.convertToWindowInsetsMap(insets: window.safeAreaInsets) 23 | } else { 24 | insets = self.convertToWindowInsetsMap(statusBarFrame: UIApplication.shared.statusBarFrame) 25 | } 26 | } else { 27 | insets = self.convertToWindowInsetsMap(statusBarFrame: UIApplication.shared.statusBarFrame) 28 | } 29 | } 30 | 31 | return insets 32 | } 33 | 34 | private func convertToWindowInsetsMap(insets: UIEdgeInsets) -> [String: Any] { 35 | return [ 36 | "leftInset": insets.left, 37 | "rightInset": insets.right, 38 | "topInset": insets.top, 39 | "bottomInset": insets.bottom, 40 | "hasNotch": insets.bottom > 0 //should be improved for landscape case for example (consider using top > 24) 41 | ] 42 | } 43 | 44 | private func convertToWindowInsetsMap(statusBarFrame frame: CGRect) -> [String: Any] { 45 | return [ 46 | "leftInset": 0, 47 | "rightInset": 0, 48 | "topInset": frame.height, 49 | "bottomInset": 0, 50 | "hasNotch": false 51 | ] 52 | } 53 | 54 | } 55 | 56 | private extension UIEdgeInsets { 57 | var isZero: Bool { 58 | return left == 0 && right == 0 && top == 0 && bottom == 0 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ios/RNWindowGuard.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 11C42B61230AE05A009D5C00 /* RNWindowGuard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1107A39D2276D81500FB0B72 /* RNWindowGuard.swift */; }; 11 | B3E7B58A1CC2AC0600A0062D /* RNWindowGuard.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNWindowGuard.m */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = "include/$(PRODUCT_NAME)"; 19 | dstSubfolderSpec = 16; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 0; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 1107A39C2276D81500FB0B72 /* RNWindowGuard-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNWindowGuard-Bridging-Header.h"; sourceTree = ""; }; 28 | 1107A39D2276D81500FB0B72 /* RNWindowGuard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNWindowGuard.swift; sourceTree = ""; }; 29 | 134814201AA4EA6300B7C361 /* libRNWindowGuard.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNWindowGuard.a; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | B3E7B5891CC2AC0600A0062D /* RNWindowGuard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNWindowGuard.m; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 134814211AA4EA7D00B7C361 /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | 134814201AA4EA6300B7C361 /* libRNWindowGuard.a */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | 58B511D21A9E6C8500147676 = { 53 | isa = PBXGroup; 54 | children = ( 55 | B3E7B5891CC2AC0600A0062D /* RNWindowGuard.m */, 56 | 1107A39D2276D81500FB0B72 /* RNWindowGuard.swift */, 57 | 1107A39C2276D81500FB0B72 /* RNWindowGuard-Bridging-Header.h */, 58 | 134814211AA4EA7D00B7C361 /* Products */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | /* End PBXGroup section */ 63 | 64 | /* Begin PBXNativeTarget section */ 65 | 58B511DA1A9E6C8500147676 /* RNWindowGuard */ = { 66 | isa = PBXNativeTarget; 67 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNWindowGuard" */; 68 | buildPhases = ( 69 | 58B511D71A9E6C8500147676 /* Sources */, 70 | 58B511D81A9E6C8500147676 /* Frameworks */, 71 | 58B511D91A9E6C8500147676 /* CopyFiles */, 72 | ); 73 | buildRules = ( 74 | ); 75 | dependencies = ( 76 | ); 77 | name = RNWindowGuard; 78 | productName = RCTDataManager; 79 | productReference = 134814201AA4EA6300B7C361 /* libRNWindowGuard.a */; 80 | productType = "com.apple.product-type.library.static"; 81 | }; 82 | /* End PBXNativeTarget section */ 83 | 84 | /* Begin PBXProject section */ 85 | 58B511D31A9E6C8500147676 /* Project object */ = { 86 | isa = PBXProject; 87 | attributes = { 88 | LastUpgradeCheck = 0920; 89 | ORGANIZATIONNAME = Facebook; 90 | TargetAttributes = { 91 | 58B511DA1A9E6C8500147676 = { 92 | CreatedOnToolsVersion = 6.1.1; 93 | LastSwiftMigration = 1010; 94 | }; 95 | }; 96 | }; 97 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNWindowGuard" */; 98 | compatibilityVersion = "Xcode 3.2"; 99 | developmentRegion = English; 100 | hasScannedForEncodings = 0; 101 | knownRegions = ( 102 | en, 103 | ); 104 | mainGroup = 58B511D21A9E6C8500147676; 105 | productRefGroup = 58B511D21A9E6C8500147676; 106 | projectDirPath = ""; 107 | projectRoot = ""; 108 | targets = ( 109 | 58B511DA1A9E6C8500147676 /* RNWindowGuard */, 110 | ); 111 | }; 112 | /* End PBXProject section */ 113 | 114 | /* Begin PBXSourcesBuildPhase section */ 115 | 58B511D71A9E6C8500147676 /* Sources */ = { 116 | isa = PBXSourcesBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | B3E7B58A1CC2AC0600A0062D /* RNWindowGuard.m in Sources */, 120 | 11C42B61230AE05A009D5C00 /* RNWindowGuard.swift in Sources */, 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | /* End PBXSourcesBuildPhase section */ 125 | 126 | /* Begin XCBuildConfiguration section */ 127 | 58B511ED1A9E6C8500147676 /* Debug */ = { 128 | isa = XCBuildConfiguration; 129 | buildSettings = { 130 | ALWAYS_SEARCH_USER_PATHS = NO; 131 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 132 | CLANG_CXX_LIBRARY = "libc++"; 133 | CLANG_ENABLE_MODULES = YES; 134 | CLANG_ENABLE_OBJC_ARC = YES; 135 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 136 | CLANG_WARN_BOOL_CONVERSION = YES; 137 | CLANG_WARN_COMMA = YES; 138 | CLANG_WARN_CONSTANT_CONVERSION = YES; 139 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 140 | CLANG_WARN_EMPTY_BODY = YES; 141 | CLANG_WARN_ENUM_CONVERSION = YES; 142 | CLANG_WARN_INFINITE_RECURSION = YES; 143 | CLANG_WARN_INT_CONVERSION = YES; 144 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 145 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 146 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 147 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 148 | CLANG_WARN_STRICT_PROTOTYPES = YES; 149 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 150 | CLANG_WARN_UNREACHABLE_CODE = YES; 151 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 152 | COPY_PHASE_STRIP = NO; 153 | ENABLE_STRICT_OBJC_MSGSEND = YES; 154 | ENABLE_TESTABILITY = YES; 155 | GCC_C_LANGUAGE_STANDARD = gnu99; 156 | GCC_DYNAMIC_NO_PIC = NO; 157 | GCC_NO_COMMON_BLOCKS = YES; 158 | GCC_OPTIMIZATION_LEVEL = 0; 159 | GCC_PREPROCESSOR_DEFINITIONS = ( 160 | "DEBUG=1", 161 | "$(inherited)", 162 | ); 163 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 164 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 165 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 166 | GCC_WARN_UNDECLARED_SELECTOR = YES; 167 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 168 | GCC_WARN_UNUSED_FUNCTION = YES; 169 | GCC_WARN_UNUSED_VARIABLE = YES; 170 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 171 | MTL_ENABLE_DEBUG_INFO = YES; 172 | ONLY_ACTIVE_ARCH = YES; 173 | SDKROOT = iphoneos; 174 | }; 175 | name = Debug; 176 | }; 177 | 58B511EE1A9E6C8500147676 /* Release */ = { 178 | isa = XCBuildConfiguration; 179 | buildSettings = { 180 | ALWAYS_SEARCH_USER_PATHS = NO; 181 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 182 | CLANG_CXX_LIBRARY = "libc++"; 183 | CLANG_ENABLE_MODULES = YES; 184 | CLANG_ENABLE_OBJC_ARC = YES; 185 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 186 | CLANG_WARN_BOOL_CONVERSION = YES; 187 | CLANG_WARN_COMMA = YES; 188 | CLANG_WARN_CONSTANT_CONVERSION = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_EMPTY_BODY = YES; 191 | CLANG_WARN_ENUM_CONVERSION = YES; 192 | CLANG_WARN_INFINITE_RECURSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 195 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 196 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 197 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 198 | CLANG_WARN_STRICT_PROTOTYPES = YES; 199 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 200 | CLANG_WARN_UNREACHABLE_CODE = YES; 201 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 202 | COPY_PHASE_STRIP = YES; 203 | ENABLE_NS_ASSERTIONS = NO; 204 | ENABLE_STRICT_OBJC_MSGSEND = YES; 205 | GCC_C_LANGUAGE_STANDARD = gnu99; 206 | GCC_NO_COMMON_BLOCKS = YES; 207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 209 | GCC_WARN_UNDECLARED_SELECTOR = YES; 210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 211 | GCC_WARN_UNUSED_FUNCTION = YES; 212 | GCC_WARN_UNUSED_VARIABLE = YES; 213 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 214 | MTL_ENABLE_DEBUG_INFO = NO; 215 | SDKROOT = iphoneos; 216 | VALIDATE_PRODUCT = YES; 217 | }; 218 | name = Release; 219 | }; 220 | 58B511F01A9E6C8500147676 /* Debug */ = { 221 | isa = XCBuildConfiguration; 222 | buildSettings = { 223 | CLANG_ENABLE_MODULES = YES; 224 | HEADER_SEARCH_PATHS = ( 225 | "$(inherited)", 226 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 227 | "$(SRCROOT)/../../../React/**", 228 | "$(SRCROOT)/../../react-native/React/**", 229 | ); 230 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 231 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 232 | OTHER_LDFLAGS = "-ObjC"; 233 | PRODUCT_NAME = RNWindowGuard; 234 | SKIP_INSTALL = YES; 235 | SWIFT_OBJC_BRIDGING_HEADER = "RNWindowGuard-Bridging-Header.h"; 236 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 237 | SWIFT_VERSION = 4.2; 238 | }; 239 | name = Debug; 240 | }; 241 | 58B511F11A9E6C8500147676 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | CLANG_ENABLE_MODULES = YES; 245 | HEADER_SEARCH_PATHS = ( 246 | "$(inherited)", 247 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 248 | "$(SRCROOT)/../../../React/**", 249 | "$(SRCROOT)/../../react-native/React/**", 250 | ); 251 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 252 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 253 | OTHER_LDFLAGS = "-ObjC"; 254 | PRODUCT_NAME = RNWindowGuard; 255 | SKIP_INSTALL = YES; 256 | SWIFT_OBJC_BRIDGING_HEADER = "RNWindowGuard-Bridging-Header.h"; 257 | SWIFT_VERSION = 4.2; 258 | }; 259 | name = Release; 260 | }; 261 | /* End XCBuildConfiguration section */ 262 | 263 | /* Begin XCConfigurationList section */ 264 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNWindowGuard" */ = { 265 | isa = XCConfigurationList; 266 | buildConfigurations = ( 267 | 58B511ED1A9E6C8500147676 /* Debug */, 268 | 58B511EE1A9E6C8500147676 /* Release */, 269 | ); 270 | defaultConfigurationIsVisible = 0; 271 | defaultConfigurationName = Release; 272 | }; 273 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNWindowGuard" */ = { 274 | isa = XCConfigurationList; 275 | buildConfigurations = ( 276 | 58B511F01A9E6C8500147676 /* Debug */, 277 | 58B511F11A9E6C8500147676 /* Release */, 278 | ); 279 | defaultConfigurationIsVisible = 0; 280 | defaultConfigurationName = Release; 281 | }; 282 | /* End XCConfigurationList section */ 283 | }; 284 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 285 | } 286 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-window-guard", 3 | "version": "1.0.6", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-window-guard", 3 | "title": "React Native Window Guard", 4 | "version": "1.0.6", 5 | "description": "SafeAreaView alternative for React Native which provides relevant window insets for both iOS and Android.", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/greenfrvr/react-native-window-guard.git", 13 | "baseUrl": "https://github.com/greenfrvr/react-native-window-guard" 14 | }, 15 | "keywords": [ 16 | "react-native" 17 | ], 18 | "author": { 19 | "name": "Artsiom Grintsevich", 20 | "email": "greenfrvr.dev@gmail.com" 21 | }, 22 | "license": "MIT", 23 | "licenseFilename": "LICENSE", 24 | "readmeFilename": "README.md", 25 | "peerDependencies": { 26 | "react": "^16.2.0", 27 | "react-native": ">=0.53.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /scripts/examples_postinstall.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * Using libraries within examples and linking them within packages.json like: 5 | * "react-native-library-name": "file:../" 6 | * will cause problems with the metro bundler if the example will run via 7 | * `react-native run-[ios|android]`. This will result in an error as the metro 8 | * bundler will find multiple versions for the same module while resolving it. 9 | * The reason for that is that if the library is installed it also copies in the 10 | * example folder itself as well as the node_modules folder of the library 11 | * although their are defined in .npmignore and should be ignored in theory. 12 | * 13 | * This postinstall script removes the node_modules folder as well as all 14 | * entries from the libraries .npmignore file within the examples node_modules 15 | * folder after the library was installed. This should resolve the metro 16 | * bundler issue mentioned above. 17 | * 18 | * It is expected this scripts lives in the libraries root folder within a 19 | * scripts folder. As first parameter the relative path to the libraries 20 | * folder within the examples node_modules folder should be provided. 21 | * An example's package.json entry could look like: 22 | * "postinstall": "node ../scripts/examples_postinstall.js node_modules/react-native-library-name/" 23 | */ 24 | 25 | 'use strict'; 26 | 27 | const fs = require('fs'); 28 | const path = require('path'); 29 | 30 | /// Delete all files and directories for the given path 31 | const removeFileDirectoryRecursively = fileDirPath => { 32 | // Remove file 33 | if (!fs.lstatSync(fileDirPath).isDirectory()) { 34 | fs.unlinkSync(fileDirPath); 35 | return; 36 | } 37 | 38 | // Go down the directory an remove each file / directory recursively 39 | fs.readdirSync(fileDirPath).forEach(entry => { 40 | const entryPath = path.join(fileDirPath, entry); 41 | removeFileDirectoryRecursively(entryPath); 42 | }); 43 | fs.rmdirSync(fileDirPath); 44 | }; 45 | 46 | /// Remove example/node_modules/react-native-library-name/node_modules directory 47 | const removeLibraryNodeModulesPath = (libraryNodeModulesPath) => { 48 | const nodeModulesPath = path.resolve(libraryNodeModulesPath, 'node_modules') 49 | 50 | if (!fs.existsSync(nodeModulesPath)) { 51 | console.log(`No node_modules path found at ${nodeModulesPath}. Skipping delete.`) 52 | return; 53 | } 54 | 55 | console.log(`Deleting: ${nodeModulesPath}`) 56 | try { 57 | removeFileDirectoryRecursively(nodeModulesPath); 58 | console.log(`Successfully deleted: ${nodeModulesPath}`) 59 | } catch (err) { 60 | console.log(`Error deleting ${nodeModulesPath}: ${err.message}`); 61 | } 62 | }; 63 | 64 | /// Remove all entries from the .npmignore within example/node_modules/react-native-library-name/ 65 | const removeLibraryNpmIgnorePaths = (npmIgnorePath, libraryNodeModulesPath) => { 66 | if (!fs.existsSync(npmIgnorePath)) { 67 | console.log(`No .npmignore path found at ${npmIgnorePath}. Skipping deleting content.`); 68 | return; 69 | } 70 | 71 | fs.readFileSync(npmIgnorePath, 'utf8').split(/\r?\n/).forEach(entry => { 72 | if (entry.length === 0) { 73 | return 74 | } 75 | 76 | const npmIgnoreLibraryNodeModulesEntryPath = path.resolve(libraryNodeModulesPath, entry); 77 | if (!fs.existsSync(npmIgnoreLibraryNodeModulesEntryPath)) { 78 | return; 79 | } 80 | 81 | console.log(`Deleting: ${npmIgnoreLibraryNodeModulesEntryPath}`) 82 | try { 83 | removeFileDirectoryRecursively(npmIgnoreLibraryNodeModulesEntryPath); 84 | console.log(`Successfully deleted: ${npmIgnoreLibraryNodeModulesEntryPath}`) 85 | } catch (err) { 86 | console.log(`Error deleting ${npmIgnoreLibraryNodeModulesEntryPath}: ${err.message}`); 87 | } 88 | }); 89 | }; 90 | 91 | // Main start sweeping process 92 | (() => { 93 | // Read out dir of example project 94 | const exampleDir = process.cwd(); 95 | 96 | // Relative libraries path within the examples node_modules directory 97 | const relativeLibraryNodeModulesPath = process.argv[2]; 98 | const libraryNodeModulesPath = path.resolve(exampleDir, relativeLibraryNodeModulesPath); 99 | 100 | 101 | removeLibraryNodeModulesPath(libraryNodeModulesPath); 102 | 103 | const npmIgnorePath = path.resolve(__dirname, '../.npmignore'); 104 | removeLibraryNpmIgnorePaths(npmIgnorePath, libraryNodeModulesPath); 105 | })(); 106 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | --------------------------------------------------------------------------------