Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 66ca898

Browse files
author
Richard Hua
committed
Upgrade example app to RN 0.33.0
1 parent ee3519f commit 66ca898

File tree

6 files changed

+227
-15
lines changed

6 files changed

+227
-15
lines changed

Examples/CodePushDemoApp/.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[ignore]
22

33
# We fork some components by platform.
4-
.*/*[.]android.js
4+
.*/*.android.js
55

66
# Ignore templates with `@flow` in header
77
.*/local-cli/generator.*

Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.pbxproj

Lines changed: 139 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
1313
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
1414
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15+
00E356F31AD99517003FC87E /* CodePushDemoAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* CodePushDemoAppTests.m */; };
1516
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
1617
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
1718
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
1819
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
1920
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
2021
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
2122
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
23+
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2224
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2325
549D09D81D528D0A00C95E36 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 549D09CD1D528CDB00C95E36 /* libCodePush.a */; };
2426
549D09DA1D528D4D00C95E36 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 549D09D91D528D4D00C95E36 /* libz.tbd */; };
@@ -61,6 +63,13 @@
6163
remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
6264
remoteInfo = RCTVibration;
6365
};
66+
00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
67+
isa = PBXContainerItemProxy;
68+
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
69+
proxyType = 1;
70+
remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
71+
remoteInfo = CodePushDemoApp;
72+
};
6473
139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
6574
isa = PBXContainerItemProxy;
6675
containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
@@ -106,29 +115,40 @@
106115
/* End PBXContainerItemProxy section */
107116

108117
/* Begin PBXFileReference section */
109-
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
110-
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = "<group>"; };
111-
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = "<group>"; };
112-
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
113-
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
114-
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
115-
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
116-
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
118+
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = main.jsbundle; sourceTree = "<group>"; };
119+
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = "<group>"; };
120+
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = "<group>"; };
121+
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = "<group>"; };
122+
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = "<group>"; };
123+
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = "<group>"; };
124+
00E356EE1AD99517003FC87E /* CodePushDemoAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CodePushDemoAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
125+
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
126+
00E356F21AD99517003FC87E /* CodePushDemoAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CodePushDemoAppTests.m; sourceTree = "<group>"; };
127+
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = "<group>"; };
128+
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = ../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = "<group>"; };
117129
13B07F961A680F5B00A75B9A /* CodePushDemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CodePushDemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
118130
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = CodePushDemoApp/AppDelegate.h; sourceTree = "<group>"; };
119131
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = CodePushDemoApp/AppDelegate.m; sourceTree = "<group>"; };
120132
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
121133
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = CodePushDemoApp/Images.xcassets; sourceTree = "<group>"; };
122134
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = CodePushDemoApp/Info.plist; sourceTree = "<group>"; };
123135
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = CodePushDemoApp/main.m; sourceTree = "<group>"; };
124-
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
136+
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../node_modules/react-native/React/React.xcodeproj; sourceTree = "<group>"; };
125137
549D09C81D528CDB00C95E36 /* CodePush.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CodePush.xcodeproj; path = ../../../ios/CodePush.xcodeproj; sourceTree = "<group>"; };
126138
549D09D91D528D4D00C95E36 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
127-
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
128-
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
139+
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = "<group>"; };
140+
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = "<group>"; };
129141
/* End PBXFileReference section */
130142

131143
/* Begin PBXFrameworksBuildPhase section */
144+
00E356EB1AD99517003FC87E /* Frameworks */ = {
145+
isa = PBXFrameworksBuildPhase;
146+
buildActionMask = 2147483647;
147+
files = (
148+
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
149+
);
150+
runOnlyForDeploymentPostprocessing = 0;
151+
};
132152
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
133153
isa = PBXFrameworksBuildPhase;
134154
buildActionMask = 2147483647;
@@ -191,6 +211,23 @@
191211
name = Products;
192212
sourceTree = "<group>";
193213
};
214+
00E356EF1AD99517003FC87E /* CodePushDemoAppTests */ = {
215+
isa = PBXGroup;
216+
children = (
217+
00E356F21AD99517003FC87E /* CodePushDemoAppTests.m */,
218+
00E356F01AD99517003FC87E /* Supporting Files */,
219+
);
220+
path = CodePushDemoAppTests;
221+
sourceTree = "<group>";
222+
};
223+
00E356F01AD99517003FC87E /* Supporting Files */ = {
224+
isa = PBXGroup;
225+
children = (
226+
00E356F11AD99517003FC87E /* Info.plist */,
227+
);
228+
name = "Supporting Files";
229+
sourceTree = "<group>";
230+
};
194231
139105B71AF99BAD00B5F7CC /* Products */ = {
195232
isa = PBXGroup;
196233
children = (
@@ -277,6 +314,7 @@
277314
549D09D91D528D4D00C95E36 /* libz.tbd */,
278315
13B07FAE1A68108700A75B9A /* CodePushDemoApp */,
279316
832341AE1AAA6A7D00B99B32 /* Libraries */,
317+
00E356EF1AD99517003FC87E /* CodePushDemoAppTests */,
280318
83CBBA001A601CBA00E9B192 /* Products */,
281319
);
282320
indentWidth = 2;
@@ -287,13 +325,32 @@
287325
isa = PBXGroup;
288326
children = (
289327
13B07F961A680F5B00A75B9A /* CodePushDemoApp.app */,
328+
00E356EE1AD99517003FC87E /* CodePushDemoAppTests.xctest */,
290329
);
291330
name = Products;
292331
sourceTree = "<group>";
293332
};
294333
/* End PBXGroup section */
295334

296335
/* Begin PBXNativeTarget section */
336+
00E356ED1AD99517003FC87E /* CodePushDemoAppTests */ = {
337+
isa = PBXNativeTarget;
338+
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "CodePushDemoAppTests" */;
339+
buildPhases = (
340+
00E356EA1AD99517003FC87E /* Sources */,
341+
00E356EB1AD99517003FC87E /* Frameworks */,
342+
00E356EC1AD99517003FC87E /* Resources */,
343+
);
344+
buildRules = (
345+
);
346+
dependencies = (
347+
00E356F51AD99517003FC87E /* PBXTargetDependency */,
348+
);
349+
name = CodePushDemoAppTests;
350+
productName = CodePushDemoAppTests;
351+
productReference = 00E356EE1AD99517003FC87E /* CodePushDemoAppTests.xctest */;
352+
productType = "com.apple.product-type.bundle.unit-test";
353+
};
297354
13B07F861A680F5B00A75B9A /* CodePushDemoApp */ = {
298355
isa = PBXNativeTarget;
299356
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "CodePushDemoApp" */;
@@ -320,6 +377,12 @@
320377
attributes = {
321378
LastUpgradeCheck = 0610;
322379
ORGANIZATIONNAME = Facebook;
380+
TargetAttributes = {
381+
00E356ED1AD99517003FC87E = {
382+
CreatedOnToolsVersion = 6.2;
383+
TestTargetID = 13B07F861A680F5B00A75B9A;
384+
};
385+
};
323386
};
324387
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "CodePushDemoApp" */;
325388
compatibilityVersion = "Xcode 3.2";
@@ -381,6 +444,7 @@
381444
projectRoot = "";
382445
targets = (
383446
13B07F861A680F5B00A75B9A /* CodePushDemoApp */,
447+
00E356ED1AD99517003FC87E /* CodePushDemoAppTests */,
384448
);
385449
};
386450
/* End PBXProject section */
@@ -466,6 +530,13 @@
466530
/* End PBXReferenceProxy section */
467531

468532
/* Begin PBXResourcesBuildPhase section */
533+
00E356EC1AD99517003FC87E /* Resources */ = {
534+
isa = PBXResourcesBuildPhase;
535+
buildActionMask = 2147483647;
536+
files = (
537+
);
538+
runOnlyForDeploymentPostprocessing = 0;
539+
};
469540
13B07F8E1A680F5B00A75B9A /* Resources */ = {
470541
isa = PBXResourcesBuildPhase;
471542
buildActionMask = 2147483647;
@@ -491,10 +562,19 @@
491562
runOnlyForDeploymentPostprocessing = 0;
492563
shellPath = /bin/sh;
493564
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
565+
showEnvVarsInLog = 1;
494566
};
495567
/* End PBXShellScriptBuildPhase section */
496568

497569
/* Begin PBXSourcesBuildPhase section */
570+
00E356EA1AD99517003FC87E /* Sources */ = {
571+
isa = PBXSourcesBuildPhase;
572+
buildActionMask = 2147483647;
573+
files = (
574+
00E356F31AD99517003FC87E /* CodePushDemoAppTests.m in Sources */,
575+
);
576+
runOnlyForDeploymentPostprocessing = 0;
577+
};
498578
13B07F871A680F5B00A75B9A /* Sources */ = {
499579
isa = PBXSourcesBuildPhase;
500580
buildActionMask = 2147483647;
@@ -506,6 +586,14 @@
506586
};
507587
/* End PBXSourcesBuildPhase section */
508588

589+
/* Begin PBXTargetDependency section */
590+
00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
591+
isa = PBXTargetDependency;
592+
target = 13B07F861A680F5B00A75B9A /* CodePushDemoApp */;
593+
targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
594+
};
595+
/* End PBXTargetDependency section */
596+
509597
/* Begin PBXVariantGroup section */
510598
13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
511599
isa = PBXVariantGroup;
@@ -519,6 +607,35 @@
519607
/* End PBXVariantGroup section */
520608

521609
/* Begin XCBuildConfiguration section */
610+
00E356F61AD99517003FC87E /* Debug */ = {
611+
isa = XCBuildConfiguration;
612+
buildSettings = {
613+
BUNDLE_LOADER = "$(TEST_HOST)";
614+
GCC_PREPROCESSOR_DEFINITIONS = (
615+
"DEBUG=1",
616+
"$(inherited)",
617+
);
618+
INFOPLIST_FILE = CodePushDemoAppTests/Info.plist;
619+
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
620+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
621+
PRODUCT_NAME = "$(TARGET_NAME)";
622+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodePushDemoApp.app/CodePushDemoApp";
623+
};
624+
name = Debug;
625+
};
626+
00E356F71AD99517003FC87E /* Release */ = {
627+
isa = XCBuildConfiguration;
628+
buildSettings = {
629+
BUNDLE_LOADER = "$(TEST_HOST)";
630+
COPY_PHASE_STRIP = NO;
631+
INFOPLIST_FILE = CodePushDemoAppTests/Info.plist;
632+
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
633+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
634+
PRODUCT_NAME = "$(TARGET_NAME)";
635+
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodePushDemoApp.app/CodePushDemoApp";
636+
};
637+
name = Release;
638+
};
522639
13B07F941A680F5B00A75B9A /* Debug */ = {
523640
isa = XCBuildConfiguration;
524641
buildSettings = {
@@ -530,7 +647,7 @@
530647
"$(SRCROOT)/../node_modules/react-native/React/**",
531648
"$(SRCROOT)/../../../ios/**",
532649
);
533-
INFOPLIST_FILE = CodePushDemoApp/Info.plist;
650+
INFOPLIST_FILE = "CodePushDemoApp/Info.plist";
534651
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
535652
OTHER_LDFLAGS = (
536653
"$(inherited)",
@@ -551,7 +668,7 @@
551668
"$(SRCROOT)/../node_modules/react-native/React/**",
552669
"$(SRCROOT)/../../../ios/**",
553670
);
554-
INFOPLIST_FILE = CodePushDemoApp/Info.plist;
671+
INFOPLIST_FILE = "CodePushDemoApp/Info.plist";
555672
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
556673
OTHER_LDFLAGS = (
557674
"$(inherited)",
@@ -651,6 +768,15 @@
651768
/* End XCBuildConfiguration section */
652769

653770
/* Begin XCConfigurationList section */
771+
00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "CodePushDemoAppTests" */ = {
772+
isa = XCConfigurationList;
773+
buildConfigurations = (
774+
00E356F61AD99517003FC87E /* Debug */,
775+
00E356F71AD99517003FC87E /* Release */,
776+
);
777+
defaultConfigurationIsVisible = 0;
778+
defaultConfigurationName = Release;
779+
};
654780
13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "CodePushDemoApp" */ = {
655781
isa = XCConfigurationList;
656782
buildConfigurations = (

Examples/CodePushDemoApp/iOS/CodePushDemoApp/Info.plist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<key>NSLocationWhenInUseUsageDescription</key>
4040
<string></string>
4141
<key>NSAppTransportSecurity</key>
42+
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
4243
<dict>
4344
<key>NSExceptionDomains</key>
4445
<dict>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#import <UIKit/UIKit.h>
2+
#import <XCTest/XCTest.h>
3+
4+
#import "RCTLog.h"
5+
#import "RCTRootView.h"
6+
7+
#define TIMEOUT_SECONDS 600
8+
#define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
9+
10+
@interface CodePushDemoAppTests : XCTestCase
11+
12+
@end
13+
14+
@implementation CodePushDemoAppTests
15+
16+
- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
17+
{
18+
if (test(view)) {
19+
return YES;
20+
}
21+
for (UIView *subview in [view subviews]) {
22+
if ([self findSubviewInView:subview matching:test]) {
23+
return YES;
24+
}
25+
}
26+
return NO;
27+
}
28+
29+
- (void)testRendersWelcomeScreen
30+
{
31+
UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
32+
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33+
BOOL foundElement = NO;
34+
35+
__block NSString *redboxError = nil;
36+
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
37+
if (level >= RCTLogLevelError) {
38+
redboxError = message;
39+
}
40+
});
41+
42+
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
43+
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
44+
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
45+
46+
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
47+
if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
48+
return YES;
49+
}
50+
return NO;
51+
}];
52+
}
53+
54+
RCTSetLogFunction(RCTDefaultLogFunction);
55+
56+
XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
57+
XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
58+
}
59+
60+
61+
@end

0 commit comments

Comments
 (0)