diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..0f7ec19 Binary files /dev/null and b/.DS_Store differ diff --git a/Examples/.DS_Store b/Examples/.DS_Store new file mode 100644 index 0000000..c0fc06a Binary files /dev/null and b/Examples/.DS_Store differ diff --git a/Examples/CodePushDemoApp/CodePushDemoApp.xcodeproj/project.pbxproj b/Examples/CodePushDemoApp/CodePushDemoApp.xcodeproj/project.pbxproj index 10fbdaa..0d3a903 100644 --- a/Examples/CodePushDemoApp/CodePushDemoApp.xcodeproj/project.pbxproj +++ b/Examples/CodePushDemoApp/CodePushDemoApp.xcodeproj/project.pbxproj @@ -25,7 +25,6 @@ 5451ACBA1B86A5B600E2A7DF /* QueryUpdateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5451ACB81B86A5B600E2A7DF /* QueryUpdateTests.m */; }; 5451ACEC1B86E40A00E2A7DF /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5451ACEB1B86E34300E2A7DF /* libRCTTest.a */; }; 54D774BA1B87DAF800F2ABF8 /* ApplyUpdateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 54D774B91B87DAF800F2ABF8 /* ApplyUpdateTests.m */; }; - 810D4E6F1BA0E99300B397E9 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 810D4E6E1BA0E99300B397E9 /* main.jsbundle */; }; 81551E1B1B3B428000F5B9F1 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 81551E0F1B3B427200F5B9F1 /* libCodePush.a */; }; /* End PBXBuildFile section */ @@ -153,7 +152,6 @@ 5451ACE61B86E34300E2A7DF /* RCTTest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTTest.xcodeproj; path = "node_modules/react-native/Libraries/RCTTest/RCTTest.xcodeproj"; sourceTree = ""; }; 54D774B91B87DAF800F2ABF8 /* ApplyUpdateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApplyUpdateTests.m; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; - 810D4E6E1BA0E99300B397E9 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; 81551E0A1B3B427200F5B9F1 /* CodePush.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CodePush.xcodeproj; path = ../../CodePush.xcodeproj; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -274,7 +272,6 @@ 13B07FAE1A68108700A75B9A /* CodePushDemoApp */ = { isa = PBXGroup; children = ( - 810D4E6E1BA0E99300B397E9 /* main.jsbundle */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FB01A68108700A75B9A /* AppDelegate.m */, 13B07FB51A68108700A75B9A /* Images.xcassets */, @@ -598,7 +595,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 810D4E6F1BA0E99300B397E9 /* main.jsbundle in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, ); diff --git a/Examples/CodePushDemoApp/CodePushDemoAppTests/ApplyUpdateTests.m b/Examples/CodePushDemoApp/CodePushDemoAppTests/ApplyUpdateTests.m index acaeda8..5375dd5 100644 --- a/Examples/CodePushDemoApp/CodePushDemoAppTests/ApplyUpdateTests.m +++ b/Examples/CodePushDemoApp/CodePushDemoAppTests/ApplyUpdateTests.m @@ -8,6 +8,7 @@ #import "RCTRootView.h" #import "RCTRedBox.h" #import "RCTAssert.h" +#import "RCTLog.h" #define FB_REFERENCE_IMAGE_DIR "\"$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages\"" @@ -66,16 +67,24 @@ RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:scriptURL moduleProvider:nil launchOptions:nil]; - RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"DownloadAndApplyUpdateTest"]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge + moduleName:@"DownloadAndApplyUpdateTest" + initialProperties:nil]; NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; BOOL foundElement = NO; - NSString *redboxError = nil; + + __block NSString *redboxError = nil; + RCTSetLogFunction(^(RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message) { + if (level >= RCTLogLevelError) { + redboxError = message; + } + }); while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; + UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController; foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { if ([NSStringFromClass([view class]) isEqualToString:@"RCTText"]){ diff --git a/Examples/CodePushDemoApp/iOS/AppDelegate.m b/Examples/CodePushDemoApp/iOS/AppDelegate.m index 0182a28..7db6178 100644 --- a/Examples/CodePushDemoApp/iOS/AppDelegate.m +++ b/Examples/CodePushDemoApp/iOS/AppDelegate.m @@ -49,6 +49,7 @@ RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"CodePushDemoApp" + initialProperties:nil launchOptions:launchOptions]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; diff --git a/scripts/.DS_Store b/scripts/.DS_Store new file mode 100644 index 0000000..986b34c Binary files /dev/null and b/scripts/.DS_Store differ