Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions RNSafeArea.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "RNSafeArea"
s.version = package['version']
s.summary = package['description']
s.license = package['license']

s.authors = package['author']
s.homepage = package['homepage']
s.platform = :ios, "9.0"

s.source = { :git => "https://github.com/brightsider/react-native-safe-area-emitter.git", :tag => "v#{s.version}" }
s.source_files = "ios/**/*.{h,m}"

s.dependency 'React'
end
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NativeModules, NativeEventEmitter } from 'react-native';
const { RNSafeArea } = NativeModules;

const safeAreaEventEmitter = new NativeEventEmitter(RNSafeArea);
const rootSafeArea = RNSafeArea.rootSafeArea || { top: 0, left: 0, bottom: 0, right: 0 };
var rootSafeArea = RNSafeArea.rootSafeArea || { top: 0, left: 0, bottom: 0, right: 0 };

addRootSafeAreaListener((result) => {
rootSafeArea = result;
Expand Down
5 changes: 5 additions & 0 deletions ios/RNSafeArea.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ - (void)dealloc {
resolve([self getSafeAreaFromInsets:[self getSafeAreaInsetsForView:view]]);
}

+ (BOOL)requiresMainQueueSetup
{
return YES;
}

- (NSDictionary *)constantsToExport {
return @{@"rootSafeArea": [self getSafeAreaFromInsets:[self getSafeAreaInsetsForView:self.rootView]]};
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-safe-area-emitter",
"version": "0.1.8",
"version": "0.1.9",
"description": "Safe area emitter of iOS for react-native",
"main": "index.js",
"scripts": {
Expand Down