From e42485243d9466fb6c00937bd9f67cee0d96de53 Mon Sep 17 00:00:00 2001 From: BO KANG Date: Tue, 24 Jan 2017 10:14:49 -0800 Subject: [PATCH] Upgrade RN 0.40 Finalization (#678) * Header changes * update the IOS header linker * header swap --- ios/CodePush.xcodeproj/project.pbxproj | 2 -- ios/CodePush/CodePush.h | 4 +++- ios/CodePush/CodePush.m | 9 +++++++++ ios/CodePush/RCTConvert+CodePushInstallMode.m | 5 +++++ ios/CodePush/RCTConvert+CodePushUpdateState.m | 5 +++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ios/CodePush.xcodeproj/project.pbxproj b/ios/CodePush.xcodeproj/project.pbxproj index 30aaec4..8613506 100644 --- a/ios/CodePush.xcodeproj/project.pbxproj +++ b/ios/CodePush.xcodeproj/project.pbxproj @@ -370,7 +370,6 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../react-native/React/**", - "$(SRCROOT)/../Examples/CodePushDemoApp/node_modules/react-native/React/**", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( @@ -389,7 +388,6 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../../react-native/React/**", - "$(SRCROOT)/../Examples/CodePushDemoApp/node_modules/react-native/React/**", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ( diff --git a/ios/CodePush/CodePush.h b/ios/CodePush/CodePush.h index 08c5674..03493f5 100644 --- a/ios/CodePush/CodePush.h +++ b/ios/CodePush/CodePush.h @@ -1,5 +1,7 @@ -#if __has_include("RCTEventEmitter.h") +#if __has_include() #import +#elif __has_include("RCTEventEmitter.h") +#import "RCTEventEmitter.h" #else #import "React/RCTEventEmitter.h" // Required when used as a Pod in a Swift project #endif diff --git a/ios/CodePush/CodePush.m b/ios/CodePush/CodePush.m index b13f65c..3a85bb7 100644 --- a/ios/CodePush/CodePush.m +++ b/ios/CodePush/CodePush.m @@ -1,9 +1,18 @@ +#if __has_include() #import #import #import #import #import #import +#else // back compatibility for RN version < 0.40 +#import "RCTAssert.h" +#import "RCTBridgeModule.h" +#import "RCTConvert.h" +#import "RCTEventDispatcher.h" +#import "RCTRootView.h" +#import "RCTUtils.h" +#endif #import "CodePush.h" diff --git a/ios/CodePush/RCTConvert+CodePushInstallMode.m b/ios/CodePush/RCTConvert+CodePushInstallMode.m index b8a4dda..f8aeaaf 100644 --- a/ios/CodePush/RCTConvert+CodePushInstallMode.m +++ b/ios/CodePush/RCTConvert+CodePushInstallMode.m @@ -1,5 +1,10 @@ #import "CodePush.h" + +#if __has_include() #import +#else +#import "RCTConvert.h" +#endif // Extending the RCTConvert class allows the React Native // bridge to handle args of type "CodePushInstallMode" diff --git a/ios/CodePush/RCTConvert+CodePushUpdateState.m b/ios/CodePush/RCTConvert+CodePushUpdateState.m index 8ca495c..eb4988d 100644 --- a/ios/CodePush/RCTConvert+CodePushUpdateState.m +++ b/ios/CodePush/RCTConvert+CodePushUpdateState.m @@ -1,5 +1,10 @@ #import "CodePush.h" + +#if __has_include() #import +#else +#import "RCTConvert.h" +#endif // Extending the RCTConvert class allows the React Native // bridge to handle args of type "CodePushUpdateState"