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

Commit eaf12e9

Browse files
committed
fix update issues
1 parent 38fbf64 commit eaf12e9

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

.DS_Store

8 KB
Binary file not shown.

Examples/.DS_Store

6 KB
Binary file not shown.

Examples/CodePushDemoApp/CodePushDemoApp.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
5451ACBA1B86A5B600E2A7DF /* QueryUpdateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5451ACB81B86A5B600E2A7DF /* QueryUpdateTests.m */; };
2626
5451ACEC1B86E40A00E2A7DF /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5451ACEB1B86E34300E2A7DF /* libRCTTest.a */; };
2727
54D774BA1B87DAF800F2ABF8 /* ApplyUpdateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 54D774B91B87DAF800F2ABF8 /* ApplyUpdateTests.m */; };
28-
810D4E6F1BA0E99300B397E9 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 810D4E6E1BA0E99300B397E9 /* main.jsbundle */; };
2928
81551E1B1B3B428000F5B9F1 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81551E0F1B3B427200F5B9F1 /* libCodePush.a */; };
3029
/* End PBXBuildFile section */
3130

@@ -153,7 +152,6 @@
153152
5451ACE61B86E34300E2A7DF /* RCTTest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTTest.xcodeproj; path = "node_modules/react-native/Libraries/RCTTest/RCTTest.xcodeproj"; sourceTree = "<group>"; };
154153
54D774B91B87DAF800F2ABF8 /* ApplyUpdateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApplyUpdateTests.m; sourceTree = "<group>"; };
155154
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
156-
810D4E6E1BA0E99300B397E9 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = "<group>"; };
157155
81551E0A1B3B427200F5B9F1 /* CodePush.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CodePush.xcodeproj; path = ../../CodePush.xcodeproj; sourceTree = "<group>"; };
158156
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
159157
/* End PBXFileReference section */
@@ -274,7 +272,6 @@
274272
13B07FAE1A68108700A75B9A /* CodePushDemoApp */ = {
275273
isa = PBXGroup;
276274
children = (
277-
810D4E6E1BA0E99300B397E9 /* main.jsbundle */,
278275
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
279276
13B07FB01A68108700A75B9A /* AppDelegate.m */,
280277
13B07FB51A68108700A75B9A /* Images.xcassets */,
@@ -598,7 +595,6 @@
598595
isa = PBXResourcesBuildPhase;
599596
buildActionMask = 2147483647;
600597
files = (
601-
810D4E6F1BA0E99300B397E9 /* main.jsbundle in Resources */,
602598
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
603599
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
604600
);

Examples/CodePushDemoApp/CodePushDemoAppTests/ApplyUpdateTests.m

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#import "RCTRootView.h"
99
#import "RCTRedBox.h"
1010
#import "RCTAssert.h"
11+
#import "RCTLog.h"
1112

1213
#define FB_REFERENCE_IMAGE_DIR "\"$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages\""
1314

@@ -66,16 +67,24 @@ - (void)testDownloadAndApplyUpdate
6667
RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:scriptURL
6768
moduleProvider:nil
6869
launchOptions:nil];
69-
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"DownloadAndApplyUpdateTest"];
70+
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
71+
moduleName:@"DownloadAndApplyUpdateTest"
72+
initialProperties:nil];
7073

7174
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
7275
BOOL foundElement = NO;
73-
NSString *redboxError = nil;
76+
77+
__block NSString *redboxError = nil;
78+
RCTSetLogFunction(^(RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message) {
79+
if (level >= RCTLogLevelError) {
80+
redboxError = message;
81+
}
82+
});
7483

7584
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
7685
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
7786
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
78-
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
87+
7988
UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController;
8089
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
8190
if ([NSStringFromClass([view class]) isEqualToString:@"RCTText"]){

Examples/CodePushDemoApp/iOS/AppDelegate.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4949

5050
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
5151
moduleName:@"CodePushDemoApp"
52+
initialProperties:nil
5253
launchOptions:launchOptions];
5354

5455
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

scripts/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)