├── .gitattributes ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── LICENSE ├── README.md ├── RNStaticSafeAreaInsets.podspec ├── android ├── README.md ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── gaspardbruno │ └── staticsafeareainsets │ ├── RNStaticSafeAreaInsetsModule.java │ └── RNStaticSafeAreaInsetsPackage.java ├── index.d.ts ├── index.js ├── ios ├── RNStaticSafeAreaInsets.h ├── RNStaticSafeAreaInsets.m ├── RNStaticSafeAreaInsets.xcodeproj │ └── project.pbxproj └── RNStaticSafeAreaInsets.xcworkspace │ └── contents.xcworkspacedata └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | ### Purpose of this MR 🎯 7 | 8 | What kind of change does this Merge Request introduce? 9 | 10 | 11 | 12 | - [ ] Feature 13 | - [ ] Bug fix 14 | - [ ] Tests only 15 | - [ ] Refactoring (no functional changes, no API changes) 16 | - [ ] Build/CI related changes 17 | - [ ] Documentation content changes 18 | - [ ] Code style update (formatting, local variables) 19 | - [ ] Other. Please describe: 20 | 21 | ### Changes 📝 22 | 23 | 24 | 25 | ### Screenshots 🖼 26 | 27 | 28 | 29 | ### Does this MR introduce a breaking change? ⚠️ 30 | 31 | - [ ] No 32 | - [ ] Yes 33 | 34 | 35 | 36 | 37 | ### Related issue 📎 38 | 39 | 40 | 41 | 42 | ### Reviewers 👀 43 | 44 | @jpamarohorta 45 | @CarlosUvaSilva 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Gaspard+Bruno 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 Static Safe Area Insets 2 | 3 | [![MIT License](https://img.shields.io/apm/l/atomic-design-ui)](https://github.com/Gaspard-Bruno/react-native-static-safe-area-insets/blob/main/LICENSE) 4 | [![GitHub last commit](https://img.shields.io/github/last-commit/Gaspard-Bruno/react-native-static-safe-area-insets)](https://github.com/Gaspard-Bruno/react-native-static-safe-area-insets/graphs/commit-activity) 5 | 6 | React Native package that exposes the Safe Area insets as constants (iOS and Android notch are supported). 7 | 8 | ## Getting Started 9 | 10 | ### Install 11 | ```sh 12 | yarn add react-native-static-safe-area-insets 13 | cd ios && pod install # for iOS 14 | ``` 15 | 16 | ### Usage 17 | 18 | ### Constants 19 | ```javascript 20 | import StaticSafeAreaInsets from 'react-native-static-safe-area-insets'; 21 | 22 | console.log('SafeArea insets top:', StaticSafeAreaInsets.safeAreaInsetsTop) 23 | // SafeArea insets top: 44 24 | 25 | console.log('SafeArea insets bottom:', StaticSafeAreaInsets.safeAreaInsetsBottom) 26 | // SafeArea insets bottom: 34 27 | 28 | console.log('SafeArea insets left:', StaticSafeAreaInsets.safeAreaInsetsLeft) 29 | // SafeArea insets left: 44 30 | 31 | console.log('SafeArea insets right:', StaticSafeAreaInsets.safeAreaInsetsRight) 32 | // SafeArea insets right: 44 33 | ``` 34 | 35 | ### Current Insets 36 | ```javascript 37 | import StaticSafeAreaInsets from 'react-native-static-safe-area-insets'; 38 | 39 | StaticSafeAreaInsets.getSafeAreaInsets((values) => { 40 | console.log('SafeArea insets top:', values.safeAreaInsetsTop) 41 | // SafeArea insets top: 44 42 | 43 | console.log('SafeArea insets bottom:', values.safeAreaInsetsBottom) 44 | // SafeArea insets bottom: 34 45 | 46 | console.log('SafeArea insets left:', values.safeAreaInsetsLeft) 47 | // SafeArea insets left: 44 48 | 49 | console.log('SafeArea insets right:', values.safeAreaInsetsRight) 50 | // SafeArea insets right: 44 51 | }) 52 | ``` 53 | 54 | ## Roadmap 55 | - Continue to support iOS & Android API updates 56 | 57 | ## Contributing 58 | Pull requests are welcome! Feel free to open issues and submit PRs, we will review them and answer back as fast as possible. 59 | 60 | ## 🚀 Authors 61 | 62 | - [@jpamarohorta](https://www.github.com/jpamarohorta) 63 | - [@CarlosUvaSilva](https://www.github.com/CarlosUvaSilva) 64 | -------------------------------------------------------------------------------- /RNStaticSafeAreaInsets.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 = "RNStaticSafeAreaInsets" 7 | s.version = package["version"] 8 | s.summary = package["description"] 9 | s.description = <<-DESC 10 | RNStaticSafeAreaInsets 11 | DESC 12 | s.homepage = package["repository"]["baseUrl"] 13 | s.license = package["license"] 14 | s.author = { "author" => package["author"]["email"] } 15 | s.platform = :ios, "9.0" 16 | s.source = { :git => "#{package["repository"]["baseUrl"]}.git", :tag => "#{s.version}" } 17 | 18 | s.source_files = "ios/**/*.{h,m}" 19 | s.requires_arc = true 20 | 21 | s.dependency "React-Core" 22 | end 23 | 24 | -------------------------------------------------------------------------------- /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.2.1' 11 | } 12 | } 13 | 14 | apply plugin: 'com.android.library' 15 | 16 | def safeExtGet(prop, fallback) { 17 | rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback 18 | } 19 | 20 | def DEFAULT_COMPILE_SDK_VERSION = 28 21 | def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' 22 | def DEFAULT_MIN_SDK_VERSION = 16 23 | def DEFAULT_TARGET_SDK_VERSION = 28 24 | 25 | android { 26 | namespace 'com.gaspardbruno.staticsafeareainsets' 27 | compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) 28 | buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) 29 | 30 | defaultConfig { 31 | minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) 32 | targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) 33 | versionCode 1 34 | versionName "1.0" 35 | } 36 | lintOptions { 37 | abortOnError false 38 | } 39 | } 40 | 41 | repositories { 42 | maven { 43 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 44 | // Matches the RN Hello World template 45 | // https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21 46 | url "$projectDir/../node_modules/react-native/android" 47 | } 48 | mavenCentral() 49 | } 50 | 51 | dependencies { 52 | implementation 'com.facebook.react:react-native:+' 53 | } 54 | 55 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/gaspardbruno/staticsafeareainsets/RNStaticSafeAreaInsetsModule.java: -------------------------------------------------------------------------------- 1 | package com.gaspardbruno.staticsafeareainsets; 2 | 3 | import com.facebook.react.bridge.Callback; 4 | import com.facebook.react.bridge.ReactApplicationContext; 5 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 6 | import com.facebook.react.bridge.ReactMethod; 7 | import com.facebook.react.bridge.WritableNativeMap; 8 | import com.facebook.react.bridge.WritableMap; 9 | import com.facebook.react.uimanager.PixelUtil; 10 | 11 | import java.util.Map; 12 | import java.util.HashMap; 13 | 14 | import android.view.WindowInsets; 15 | import android.view.View; 16 | import android.view.WindowInsetsController; 17 | import android.os.Build; 18 | import android.app.Activity; 19 | import android.graphics.Insets; 20 | 21 | public class RNStaticSafeAreaInsetsModule extends ReactContextBaseJavaModule { 22 | 23 | private final ReactApplicationContext reactContext; 24 | 25 | public RNStaticSafeAreaInsetsModule(ReactApplicationContext reactContext) { 26 | super(reactContext); 27 | this.reactContext = reactContext; 28 | } 29 | 30 | @Override 31 | public String getName() { 32 | return "RNStaticSafeAreaInsets"; 33 | } 34 | 35 | @Override 36 | public Map getConstants() { 37 | return this._getSafeAreaInsets(); 38 | } 39 | 40 | private Map _getSafeAreaInsets() { 41 | final Map constants = new HashMap<>(); 42 | 43 | if (getCurrentActivity() != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 44 | final Activity activity = getCurrentActivity(); 45 | final View view = activity.getWindow().getDecorView(); 46 | final WindowInsets insets = view.getRootWindowInsets(); 47 | 48 | final Boolean isFullscreen = (view.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_IMMERSIVE) == View.SYSTEM_UI_FLAG_IMMERSIVE; 49 | 50 | if (insets != null && isFullscreen) { 51 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { 52 | final Insets insets30 = insets.getInsets(WindowInsets.Type.systemGestures()); 53 | 54 | constants.put("safeAreaInsetsTop", (float) insets30.top); 55 | constants.put("safeAreaInsetsBottom", (float) insets30.bottom); 56 | constants.put("safeAreaInsetsLeft", (float) insets30.left); 57 | constants.put("safeAreaInsetsRight", (float) insets30.right); 58 | } else { 59 | constants.put("safeAreaInsetsTop", PixelUtil.toDIPFromPixel(insets.getSystemWindowInsetTop())); 60 | constants.put("safeAreaInsetsBottom", PixelUtil.toDIPFromPixel(insets.getSystemWindowInsetBottom())); 61 | constants.put("safeAreaInsetsLeft", PixelUtil.toDIPFromPixel(insets.getSystemWindowInsetLeft())); 62 | constants.put("safeAreaInsetsRight", PixelUtil.toDIPFromPixel(insets.getSystemWindowInsetRight())); 63 | } 64 | } else { 65 | constants.put("safeAreaInsetsTop", 0f); 66 | constants.put("safeAreaInsetsBottom", 0f); 67 | constants.put("safeAreaInsetsLeft", 0f); 68 | constants.put("safeAreaInsetsRight", 0f); 69 | } 70 | } else { 71 | constants.put("safeAreaInsetsTop", 0f); 72 | constants.put("safeAreaInsetsBottom", 0f); 73 | constants.put("safeAreaInsetsLeft", 0f); 74 | constants.put("safeAreaInsetsRight", 0f); 75 | } 76 | 77 | return constants; 78 | } 79 | 80 | @ReactMethod 81 | public void getSafeAreaInsets(Callback cb) { 82 | Map constants = this._getSafeAreaInsets(); 83 | WritableMap map = new WritableNativeMap(); 84 | 85 | map.putInt("safeAreaInsetsTop", ((Float) constants.get("safeAreaInsetsTop")).intValue()); 86 | map.putInt("safeAreaInsetsBottom", ((Float) constants.get("safeAreaInsetsBottom")).intValue()); 87 | map.putInt("safeAreaInsetsLeft", ((Float) constants.get("safeAreaInsetsLeft")).intValue()); 88 | map.putInt("safeAreaInsetsRight", ((Float) constants.get("safeAreaInsetsRight")).intValue()); 89 | 90 | cb.invoke(map); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /android/src/main/java/com/gaspardbruno/staticsafeareainsets/RNStaticSafeAreaInsetsPackage.java: -------------------------------------------------------------------------------- 1 | package com.gaspardbruno.staticsafeareainsets; 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 RNStaticSafeAreaInsetsPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNStaticSafeAreaInsetsModule(reactContext)); 17 | } 18 | 19 | // Deprecated from RN 0.47 20 | public List> createJSModules() { 21 | return Collections.emptyList(); 22 | } 23 | 24 | @Override 25 | public List createViewManagers(ReactApplicationContext reactContext) { 26 | return Collections.emptyList(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'react-native-static-safe-area-insets' { 2 | class StaticSafeAreaInsets { 3 | public static safeAreaInsetsTop: number; 4 | public static safeAreaInsetsBottom: number; 5 | public static safeAreaInsetsLeft: number; 6 | public static safeAreaInsetsRight: number; 7 | public static getSafeAreaInsets(callback:(insets:{ 8 | safeAreaInsetsTop: number; 9 | safeAreaInsetsBottom: number; 10 | safeAreaInsetsLeft: number; 11 | safeAreaInsetsRight: number; 12 | }) => void): void; 13 | } 14 | 15 | export default StaticSafeAreaInsets; 16 | } 17 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { NativeModules } from 'react-native'; 2 | 3 | const { RNStaticSafeAreaInsets } = NativeModules; 4 | 5 | export default RNStaticSafeAreaInsets; 6 | -------------------------------------------------------------------------------- /ios/RNStaticSafeAreaInsets.h: -------------------------------------------------------------------------------- 1 | #if __has_include() 2 | #import 3 | #else 4 | #import "RCTBridgeModule.h" 5 | #endif 6 | 7 | @interface RNStaticSafeAreaInsets : NSObject 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /ios/RNStaticSafeAreaInsets.m: -------------------------------------------------------------------------------- 1 | #import "RNStaticSafeAreaInsets.h" 2 | #import 3 | 4 | @implementation RNStaticSafeAreaInsets 5 | 6 | RCT_EXPORT_MODULE() 7 | 8 | - (dispatch_queue_t)methodQueue 9 | { 10 | return dispatch_get_main_queue(); 11 | } 12 | 13 | + (BOOL)requiresMainQueueSetup 14 | { 15 | return YES; 16 | } 17 | 18 | - (NSDictionary *)constantsToExport 19 | { 20 | return self.getSafeAreaInsets; 21 | } 22 | 23 | - (NSDictionary *) getSafeAreaInsets 24 | { 25 | if (@available(iOS 11.0, *)) { 26 | return @{ 27 | @"safeAreaInsetsTop": @(UIApplication.sharedApplication.keyWindow.safeAreaInsets.top), 28 | @"safeAreaInsetsBottom": @(UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom), 29 | @"safeAreaInsetsLeft": @(UIApplication.sharedApplication.keyWindow.safeAreaInsets.left), 30 | @"safeAreaInsetsRight": @(UIApplication.sharedApplication.keyWindow.safeAreaInsets.right) 31 | }; 32 | } else { 33 | return @{ 34 | @"safeAreaInsetsTop": @(0), 35 | @"safeAreaInsetsBottom": @(0), 36 | @"safeAreaInsetsLeft": @(0), 37 | @"safeAreaInsetsRight": @(0), 38 | }; 39 | } 40 | } 41 | 42 | RCT_EXPORT_METHOD(getSafeAreaInsets:(RCTResponseSenderBlock)callback){ 43 | callback(@[self.getSafeAreaInsets]); 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ios/RNStaticSafeAreaInsets.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B3E7B58A1CC2AC0600A0062D /* RNStaticSafeAreaInsets.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNStaticSafeAreaInsets.m */; }; 11 | /* End PBXBuildFile section */ 12 | 13 | /* Begin PBXCopyFilesBuildPhase section */ 14 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 15 | isa = PBXCopyFilesBuildPhase; 16 | buildActionMask = 2147483647; 17 | dstPath = "include/$(PRODUCT_NAME)"; 18 | dstSubfolderSpec = 16; 19 | files = ( 20 | ); 21 | runOnlyForDeploymentPostprocessing = 0; 22 | }; 23 | /* End PBXCopyFilesBuildPhase section */ 24 | 25 | /* Begin PBXFileReference section */ 26 | 134814201AA4EA6300B7C361 /* libRNStaticSafeAreaInsets.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNStaticSafeAreaInsets.a; sourceTree = BUILT_PRODUCTS_DIR; }; 27 | B3E7B5881CC2AC0600A0062D /* RNStaticSafeAreaInsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNStaticSafeAreaInsets.h; sourceTree = ""; }; 28 | B3E7B5891CC2AC0600A0062D /* RNStaticSafeAreaInsets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNStaticSafeAreaInsets.m; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 134814211AA4EA7D00B7C361 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | 134814201AA4EA6300B7C361 /* libRNStaticSafeAreaInsets.a */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | 58B511D21A9E6C8500147676 = { 51 | isa = PBXGroup; 52 | children = ( 53 | B3E7B5881CC2AC0600A0062D /* RNStaticSafeAreaInsets.h */, 54 | B3E7B5891CC2AC0600A0062D /* RNStaticSafeAreaInsets.m */, 55 | 134814211AA4EA7D00B7C361 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | /* End PBXGroup section */ 60 | 61 | /* Begin PBXNativeTarget section */ 62 | 58B511DA1A9E6C8500147676 /* RNStaticSafeAreaInsets */ = { 63 | isa = PBXNativeTarget; 64 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNStaticSafeAreaInsets" */; 65 | buildPhases = ( 66 | 58B511D71A9E6C8500147676 /* Sources */, 67 | 58B511D81A9E6C8500147676 /* Frameworks */, 68 | 58B511D91A9E6C8500147676 /* CopyFiles */, 69 | ); 70 | buildRules = ( 71 | ); 72 | dependencies = ( 73 | ); 74 | name = RNStaticSafeAreaInsets; 75 | productName = RCTDataManager; 76 | productReference = 134814201AA4EA6300B7C361 /* libRNStaticSafeAreaInsets.a */; 77 | productType = "com.apple.product-type.library.static"; 78 | }; 79 | /* End PBXNativeTarget section */ 80 | 81 | /* Begin PBXProject section */ 82 | 58B511D31A9E6C8500147676 /* Project object */ = { 83 | isa = PBXProject; 84 | attributes = { 85 | LastUpgradeCheck = 0920; 86 | ORGANIZATIONNAME = Facebook; 87 | TargetAttributes = { 88 | 58B511DA1A9E6C8500147676 = { 89 | CreatedOnToolsVersion = 6.1.1; 90 | }; 91 | }; 92 | }; 93 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNStaticSafeAreaInsets" */; 94 | compatibilityVersion = "Xcode 3.2"; 95 | developmentRegion = English; 96 | hasScannedForEncodings = 0; 97 | knownRegions = ( 98 | en, 99 | ); 100 | mainGroup = 58B511D21A9E6C8500147676; 101 | productRefGroup = 58B511D21A9E6C8500147676; 102 | projectDirPath = ""; 103 | projectRoot = ""; 104 | targets = ( 105 | 58B511DA1A9E6C8500147676 /* RNStaticSafeAreaInsets */, 106 | ); 107 | }; 108 | /* End PBXProject section */ 109 | 110 | /* Begin PBXSourcesBuildPhase section */ 111 | 58B511D71A9E6C8500147676 /* Sources */ = { 112 | isa = PBXSourcesBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | B3E7B58A1CC2AC0600A0062D /* RNStaticSafeAreaInsets.m in Sources */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXSourcesBuildPhase section */ 120 | 121 | /* Begin XCBuildConfiguration section */ 122 | 58B511ED1A9E6C8500147676 /* Debug */ = { 123 | isa = XCBuildConfiguration; 124 | buildSettings = { 125 | ALWAYS_SEARCH_USER_PATHS = NO; 126 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 127 | CLANG_CXX_LIBRARY = "libc++"; 128 | CLANG_ENABLE_MODULES = YES; 129 | CLANG_ENABLE_OBJC_ARC = YES; 130 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 131 | CLANG_WARN_BOOL_CONVERSION = YES; 132 | CLANG_WARN_COMMA = YES; 133 | CLANG_WARN_CONSTANT_CONVERSION = YES; 134 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 135 | CLANG_WARN_EMPTY_BODY = YES; 136 | CLANG_WARN_ENUM_CONVERSION = YES; 137 | CLANG_WARN_INFINITE_RECURSION = YES; 138 | CLANG_WARN_INT_CONVERSION = YES; 139 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 140 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 141 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 142 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 143 | CLANG_WARN_STRICT_PROTOTYPES = YES; 144 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 145 | CLANG_WARN_UNREACHABLE_CODE = YES; 146 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 147 | COPY_PHASE_STRIP = NO; 148 | ENABLE_STRICT_OBJC_MSGSEND = YES; 149 | ENABLE_TESTABILITY = YES; 150 | GCC_C_LANGUAGE_STANDARD = gnu99; 151 | GCC_DYNAMIC_NO_PIC = NO; 152 | GCC_NO_COMMON_BLOCKS = YES; 153 | GCC_OPTIMIZATION_LEVEL = 0; 154 | GCC_PREPROCESSOR_DEFINITIONS = ( 155 | "DEBUG=1", 156 | "$(inherited)", 157 | ); 158 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 159 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 160 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 161 | GCC_WARN_UNDECLARED_SELECTOR = YES; 162 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 163 | GCC_WARN_UNUSED_FUNCTION = YES; 164 | GCC_WARN_UNUSED_VARIABLE = YES; 165 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 166 | MTL_ENABLE_DEBUG_INFO = YES; 167 | ONLY_ACTIVE_ARCH = YES; 168 | SDKROOT = iphoneos; 169 | }; 170 | name = Debug; 171 | }; 172 | 58B511EE1A9E6C8500147676 /* Release */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 177 | CLANG_CXX_LIBRARY = "libc++"; 178 | CLANG_ENABLE_MODULES = YES; 179 | CLANG_ENABLE_OBJC_ARC = YES; 180 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 181 | CLANG_WARN_BOOL_CONVERSION = YES; 182 | CLANG_WARN_COMMA = YES; 183 | CLANG_WARN_CONSTANT_CONVERSION = YES; 184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 185 | CLANG_WARN_EMPTY_BODY = YES; 186 | CLANG_WARN_ENUM_CONVERSION = YES; 187 | CLANG_WARN_INFINITE_RECURSION = YES; 188 | CLANG_WARN_INT_CONVERSION = YES; 189 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 190 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 191 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 192 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 193 | CLANG_WARN_STRICT_PROTOTYPES = YES; 194 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = YES; 198 | ENABLE_NS_ASSERTIONS = NO; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu99; 201 | GCC_NO_COMMON_BLOCKS = YES; 202 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 203 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 204 | GCC_WARN_UNDECLARED_SELECTOR = YES; 205 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 206 | GCC_WARN_UNUSED_FUNCTION = YES; 207 | GCC_WARN_UNUSED_VARIABLE = YES; 208 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 209 | MTL_ENABLE_DEBUG_INFO = NO; 210 | SDKROOT = iphoneos; 211 | VALIDATE_PRODUCT = YES; 212 | }; 213 | name = Release; 214 | }; 215 | 58B511F01A9E6C8500147676 /* Debug */ = { 216 | isa = XCBuildConfiguration; 217 | buildSettings = { 218 | HEADER_SEARCH_PATHS = ( 219 | "$(inherited)", 220 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 221 | "$(SRCROOT)/../../../React/**", 222 | "$(SRCROOT)/../../react-native/React/**", 223 | ); 224 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 225 | OTHER_LDFLAGS = "-ObjC"; 226 | PRODUCT_NAME = RNStaticSafeAreaInsets; 227 | SKIP_INSTALL = YES; 228 | }; 229 | name = Debug; 230 | }; 231 | 58B511F11A9E6C8500147676 /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | HEADER_SEARCH_PATHS = ( 235 | "$(inherited)", 236 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 237 | "$(SRCROOT)/../../../React/**", 238 | "$(SRCROOT)/../../react-native/React/**", 239 | ); 240 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 241 | OTHER_LDFLAGS = "-ObjC"; 242 | PRODUCT_NAME = RNStaticSafeAreaInsets; 243 | SKIP_INSTALL = YES; 244 | }; 245 | name = Release; 246 | }; 247 | /* End XCBuildConfiguration section */ 248 | 249 | /* Begin XCConfigurationList section */ 250 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNStaticSafeAreaInsets" */ = { 251 | isa = XCConfigurationList; 252 | buildConfigurations = ( 253 | 58B511ED1A9E6C8500147676 /* Debug */, 254 | 58B511EE1A9E6C8500147676 /* Release */, 255 | ); 256 | defaultConfigurationIsVisible = 0; 257 | defaultConfigurationName = Release; 258 | }; 259 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNStaticSafeAreaInsets" */ = { 260 | isa = XCConfigurationList; 261 | buildConfigurations = ( 262 | 58B511F01A9E6C8500147676 /* Debug */, 263 | 58B511F11A9E6C8500147676 /* Release */, 264 | ); 265 | defaultConfigurationIsVisible = 0; 266 | defaultConfigurationName = Release; 267 | }; 268 | /* End XCConfigurationList section */ 269 | }; 270 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 271 | } 272 | -------------------------------------------------------------------------------- /ios/RNStaticSafeAreaInsets.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-static-safe-area-insets", 3 | "title": "React Native Static Safe Area Insets", 4 | "version": "2.2.0", 5 | "description": "React Native package that exposed the Safe Area insets as constants", 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/Gaspard-Bruno/react-native-static-safe-area-insets.git", 13 | "baseUrl": "https://github.com/Gaspard-Bruno/react-native-static-safe-area-insets" 14 | }, 15 | "keywords": [ 16 | "react-native" 17 | ], 18 | "author": { 19 | "name": "Gaspard+Bruno", 20 | "email": "hello@gaspardbruno.com" 21 | }, 22 | "types": "index.d.ts", 23 | "license": "MIT", 24 | "licenseFilename": "LICENSE", 25 | "readmeFilename": "README.md" 26 | } 27 | --------------------------------------------------------------------------------