Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 8eccb75

Browse files
committed
Link IOS native module to example
1 parent c6fd0b4 commit 8eccb75

File tree

9 files changed

+111
-86
lines changed

9 files changed

+111
-86
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Getting started
44

5-
`$ npm install react-native-status-bar --save`
5+
`$ npm install @react-native-community/status-bar --save`
66

77
### Mostly automatic installation
88

9-
`$ react-native link react-native-status-bar`
9+
`$ react-native link @react-native-community/status-bar`
1010

1111
### Manual installation
1212

example/ios/StatusBarExample.xcodeproj/project.pbxproj

+94-61
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
3939
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
4040
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
41+
B9903065220E218F00AD1234 /* libRNCStatusBar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B9903064220E217500AD1234 /* libRNCStatusBar.a */; };
4142
ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
4243
ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; };
4344
/* End PBXBuildFile section */
@@ -176,20 +177,6 @@
176177
remoteGlobalIDString = 3D383D621EBD27B9005632C8;
177178
remoteInfo = "double-conversion-tvOS";
178179
};
179-
2DF0FFEA2056DD460020B375 /* PBXContainerItemProxy */ = {
180-
isa = PBXContainerItemProxy;
181-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
182-
proxyType = 2;
183-
remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
184-
remoteInfo = privatedata;
185-
};
186-
2DF0FFEC2056DD460020B375 /* PBXContainerItemProxy */ = {
187-
isa = PBXContainerItemProxy;
188-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
189-
proxyType = 2;
190-
remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
191-
remoteInfo = "privatedata-tvOS";
192-
};
193180
3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {
194181
isa = PBXContainerItemProxy;
195182
containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
@@ -267,20 +254,6 @@
267254
remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
268255
remoteInfo = "cxxreact-tvOS";
269256
};
270-
3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
271-
isa = PBXContainerItemProxy;
272-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
273-
proxyType = 2;
274-
remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
275-
remoteInfo = jschelpers;
276-
};
277-
3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = {
278-
isa = PBXContainerItemProxy;
279-
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
280-
proxyType = 2;
281-
remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
282-
remoteInfo = "jschelpers-tvOS";
283-
};
284257
5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = {
285258
isa = PBXContainerItemProxy;
286259
containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */;
@@ -316,6 +289,41 @@
316289
remoteGlobalIDString = 358F4ED71D1E81A9004DF814;
317290
remoteInfo = RCTBlob;
318291
};
292+
B9902F51220E11A700AD1234 /* PBXContainerItemProxy */ = {
293+
isa = PBXContainerItemProxy;
294+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
295+
proxyType = 2;
296+
remoteGlobalIDString = EDEBC6D6214B3E7000DD5AC8;
297+
remoteInfo = jsi;
298+
};
299+
B9902F53220E11A700AD1234 /* PBXContainerItemProxy */ = {
300+
isa = PBXContainerItemProxy;
301+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
302+
proxyType = 2;
303+
remoteGlobalIDString = EDEBC73B214B45A300DD5AC8;
304+
remoteInfo = jsiexecutor;
305+
};
306+
B9902F55220E11A700AD1234 /* PBXContainerItemProxy */ = {
307+
isa = PBXContainerItemProxy;
308+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
309+
proxyType = 2;
310+
remoteGlobalIDString = ED296FB6214C9A0900B7C4FE;
311+
remoteInfo = "jsi-tvOS";
312+
};
313+
B9902F57220E11A700AD1234 /* PBXContainerItemProxy */ = {
314+
isa = PBXContainerItemProxy;
315+
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
316+
proxyType = 2;
317+
remoteGlobalIDString = ED296FEE214C9CF800B7C4FE;
318+
remoteInfo = "jsiexecutor-tvOS";
319+
};
320+
B9903063220E217500AD1234 /* PBXContainerItemProxy */ = {
321+
isa = PBXContainerItemProxy;
322+
containerPortal = B990305F220E217500AD1234 /* RNCStatusBar.xcodeproj */;
323+
proxyType = 2;
324+
remoteGlobalIDString = 134814201AA4EA6300B7C361;
325+
remoteInfo = RNCStatusBar;
326+
};
319327
/* End PBXContainerItemProxy section */
320328

321329
/* Begin PBXFileReference section */
@@ -345,6 +353,7 @@
345353
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
346354
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
347355
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
356+
B990305F220E217500AD1234 /* RNCStatusBar.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNCStatusBar.xcodeproj; path = ../../ios/RNCStatusBar.xcodeproj; sourceTree = "<group>"; };
348357
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
349358
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; };
350359
/* End PBXFileReference section */
@@ -375,6 +384,7 @@
375384
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
376385
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
377386
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
387+
B9903065220E218F00AD1234 /* libRNCStatusBar.a in Frameworks */,
378388
);
379389
runOnlyForDeploymentPostprocessing = 0;
380390
};
@@ -507,16 +517,16 @@
507517
3DAD3EA71DF850E9000B6D8A /* libyoga.a */,
508518
3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,
509519
3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
510-
3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
511-
3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
512520
2DF0FFDF2056DD460020B375 /* libjsinspector.a */,
513521
2DF0FFE12056DD460020B375 /* libjsinspector-tvOS.a */,
514522
2DF0FFE32056DD460020B375 /* libthird-party.a */,
515523
2DF0FFE52056DD460020B375 /* libthird-party.a */,
516524
2DF0FFE72056DD460020B375 /* libdouble-conversion.a */,
517525
2DF0FFE92056DD460020B375 /* libdouble-conversion.a */,
518-
2DF0FFEB2056DD460020B375 /* libprivatedata.a */,
519-
2DF0FFED2056DD460020B375 /* libprivatedata-tvOS.a */,
526+
B9902F52220E11A700AD1234 /* libjsi.a */,
527+
B9902F54220E11A700AD1234 /* libjsiexecutor.a */,
528+
B9902F56220E11A700AD1234 /* libjsi-tvOS.a */,
529+
B9902F58220E11A700AD1234 /* libjsiexecutor-tvOS.a */,
520530
);
521531
name = Products;
522532
sourceTree = "<group>";
@@ -563,6 +573,7 @@
563573
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
564574
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
565575
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
576+
B990305F220E217500AD1234 /* RNCStatusBar.xcodeproj */,
566577
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
567578
);
568579
name = Libraries;
@@ -611,6 +622,14 @@
611622
name = Products;
612623
sourceTree = "<group>";
613624
};
625+
B9903060220E217500AD1234 /* Products */ = {
626+
isa = PBXGroup;
627+
children = (
628+
B9903064220E217500AD1234 /* libRNCStatusBar.a */,
629+
);
630+
name = Products;
631+
sourceTree = "<group>";
632+
};
614633
/* End PBXGroup section */
615634

616635
/* Begin PBXNativeTarget section */
@@ -770,6 +789,10 @@
770789
ProductGroup = 146834001AC3E56700842450 /* Products */;
771790
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
772791
},
792+
{
793+
ProductGroup = B9903060220E217500AD1234 /* Products */;
794+
ProjectRef = B990305F220E217500AD1234 /* RNCStatusBar.xcodeproj */;
795+
},
773796
);
774797
projectRoot = "";
775798
targets = (
@@ -901,20 +924,6 @@
901924
remoteRef = 2DF0FFE82056DD460020B375 /* PBXContainerItemProxy */;
902925
sourceTree = BUILT_PRODUCTS_DIR;
903926
};
904-
2DF0FFEB2056DD460020B375 /* libprivatedata.a */ = {
905-
isa = PBXReferenceProxy;
906-
fileType = archive.ar;
907-
path = libprivatedata.a;
908-
remoteRef = 2DF0FFEA2056DD460020B375 /* PBXContainerItemProxy */;
909-
sourceTree = BUILT_PRODUCTS_DIR;
910-
};
911-
2DF0FFED2056DD460020B375 /* libprivatedata-tvOS.a */ = {
912-
isa = PBXReferenceProxy;
913-
fileType = archive.ar;
914-
path = "libprivatedata-tvOS.a";
915-
remoteRef = 2DF0FFEC2056DD460020B375 /* PBXContainerItemProxy */;
916-
sourceTree = BUILT_PRODUCTS_DIR;
917-
};
918927
3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
919928
isa = PBXReferenceProxy;
920929
fileType = archive.ar;
@@ -992,20 +1001,6 @@
9921001
remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */;
9931002
sourceTree = BUILT_PRODUCTS_DIR;
9941003
};
995-
3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = {
996-
isa = PBXReferenceProxy;
997-
fileType = archive.ar;
998-
path = libjschelpers.a;
999-
remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */;
1000-
sourceTree = BUILT_PRODUCTS_DIR;
1001-
};
1002-
3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = {
1003-
isa = PBXReferenceProxy;
1004-
fileType = archive.ar;
1005-
path = libjschelpers.a;
1006-
remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */;
1007-
sourceTree = BUILT_PRODUCTS_DIR;
1008-
};
10091004
5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = {
10101005
isa = PBXReferenceProxy;
10111006
fileType = archive.ar;
@@ -1041,6 +1036,41 @@
10411036
remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */;
10421037
sourceTree = BUILT_PRODUCTS_DIR;
10431038
};
1039+
B9902F52220E11A700AD1234 /* libjsi.a */ = {
1040+
isa = PBXReferenceProxy;
1041+
fileType = archive.ar;
1042+
path = libjsi.a;
1043+
remoteRef = B9902F51220E11A700AD1234 /* PBXContainerItemProxy */;
1044+
sourceTree = BUILT_PRODUCTS_DIR;
1045+
};
1046+
B9902F54220E11A700AD1234 /* libjsiexecutor.a */ = {
1047+
isa = PBXReferenceProxy;
1048+
fileType = archive.ar;
1049+
path = libjsiexecutor.a;
1050+
remoteRef = B9902F53220E11A700AD1234 /* PBXContainerItemProxy */;
1051+
sourceTree = BUILT_PRODUCTS_DIR;
1052+
};
1053+
B9902F56220E11A700AD1234 /* libjsi-tvOS.a */ = {
1054+
isa = PBXReferenceProxy;
1055+
fileType = archive.ar;
1056+
path = "libjsi-tvOS.a";
1057+
remoteRef = B9902F55220E11A700AD1234 /* PBXContainerItemProxy */;
1058+
sourceTree = BUILT_PRODUCTS_DIR;
1059+
};
1060+
B9902F58220E11A700AD1234 /* libjsiexecutor-tvOS.a */ = {
1061+
isa = PBXReferenceProxy;
1062+
fileType = archive.ar;
1063+
path = "libjsiexecutor-tvOS.a";
1064+
remoteRef = B9902F57220E11A700AD1234 /* PBXContainerItemProxy */;
1065+
sourceTree = BUILT_PRODUCTS_DIR;
1066+
};
1067+
B9903064220E217500AD1234 /* libRNCStatusBar.a */ = {
1068+
isa = PBXReferenceProxy;
1069+
fileType = archive.ar;
1070+
path = libRNCStatusBar.a;
1071+
remoteRef = B9903063220E217500AD1234 /* PBXContainerItemProxy */;
1072+
sourceTree = BUILT_PRODUCTS_DIR;
1073+
};
10441074
/* End PBXReferenceProxy section */
10451075

10461076
/* Begin PBXResourcesBuildPhase section */
@@ -1090,7 +1120,7 @@
10901120
);
10911121
runOnlyForDeploymentPostprocessing = 0;
10921122
shellPath = /bin/sh;
1093-
shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh";
1123+
shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh\n";
10941124
};
10951125
2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
10961126
isa = PBXShellScriptBuildPhase;
@@ -1216,6 +1246,8 @@
12161246
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12171247
CURRENT_PROJECT_VERSION = 1;
12181248
DEAD_CODE_STRIPPING = NO;
1249+
HEADER_SEARCH_PATHS = "$(SRCROOT)/../ios";
1250+
"HEADER_SEARCH_PATHS[arch=*]" = "";
12191251
INFOPLIST_FILE = StatusBarExample/Info.plist;
12201252
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
12211253
OTHER_LDFLAGS = (
@@ -1234,6 +1266,7 @@
12341266
buildSettings = {
12351267
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12361268
CURRENT_PROJECT_VERSION = 1;
1269+
HEADER_SEARCH_PATHS = "$(SRCROOT)/../ios";
12371270
INFOPLIST_FILE = StatusBarExample/Info.plist;
12381271
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
12391272
OTHER_LDFLAGS = (

ios/RNCStatusBar.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
@end
2121

22-
@interface RCTStatusBarManager : RCTEventEmitter
22+
@interface RNCStatusBarManager : RCTEventEmitter
2323

2424
@end

ios/RNCStatusBar.m

+7-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import "RCTStatusBarManager.h"
8+
#import "RNCStatusBar.h"
9+
10+
#import <React/RCTEventDispatcher.h>
11+
#import <React/RCTLog.h>
12+
#import <React/RCTUtils.h>
913

10-
#import "RCTEventDispatcher.h"
11-
#import "RCTLog.h"
12-
#import "RCTUtils.h"
1314

1415
#if !TARGET_OS_TV
1516
@implementation RCTConvert (UIStatusBar)
@@ -29,7 +30,7 @@ @implementation RCTConvert (UIStatusBar)
2930
@end
3031
#endif
3132

32-
@implementation RCTStatusBarManager
33+
@implementation RNCStatusBarManager
3334

3435
static BOOL RCTViewControllerBasedStatusBarAppearance()
3536
{
@@ -132,4 +133,4 @@ - (void)applicationWillChangeStatusBarFrame:(NSNotification *)notification
132133

133134
#endif //TARGET_OS_TV
134135

135-
@end
136+
@end

ios/RNCStatusBar.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@
204204
isa = XCBuildConfiguration;
205205
buildSettings = {
206206
HEADER_SEARCH_PATHS = (
207-
"$(inherited)",
207+
"$(inherited)",
208208
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
209-
"$(SRCROOT)/../../../React/**",
209+
"$(SRCROOT)/../../React/**",
210210
"$(SRCROOT)/../../react-native/React/**",
211211
);
212212
LIBRARY_SEARCH_PATHS = "$(inherited)";
@@ -222,7 +222,7 @@
222222
HEADER_SEARCH_PATHS = (
223223
"$(inherited)",
224224
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
225-
"$(SRCROOT)/../../../React/**",
225+
"$(SRCROOT)/../../React/**",
226226
"$(SRCROOT)/../../react-native/React/**",
227227
);
228228
LIBRARY_SEARCH_PATHS = "$(inherited)";

ios/RNCStatusBar.xcworkspace/contents.xcworkspacedata

-9
This file was deleted.

js/StatusBar.android.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ const NativeEventEmitter = require('NativeEventEmitter');
1414

1515
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found when
1616
* making Flow check .android.js files. */
17-
module.exports = new NativeEventEmitter('StatusBarManager');
17+
module.exports = new NativeEventEmitter('RNCStatusBarManager');

js/StatusBar.ios.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
'use strict';
1313

1414
const NativeEventEmitter = require('NativeEventEmitter');
15-
const {StatusBarManager} = require('NativeModules');
15+
const Modules = require('NativeModules');
1616

1717
/**
1818
* Use `StatusBar` for mutating the status bar.
1919
*/
2020
class StatusBarIOS extends NativeEventEmitter {}
2121

22-
module.exports = new StatusBarIOS(StatusBarManager);
22+
module.exports = new StatusBarIOS(Modules.RNCStatusBarManager);

js/StatusBar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Platform = require('Platform');
1515

1616
const processColor = require('processColor');
1717

18-
const StatusBarManager = require('NativeModules').StatusBarManager;
18+
const StatusBarManager = require('NativeModules').RNCStatusBarManager;
1919

2020
/**
2121
* Status bar style

0 commit comments

Comments
 (0)