From 8f37ee02e7256068cf51f84161fd0da050e7d2e0 Mon Sep 17 00:00:00 2001 From: "alexander.goncharov" Date: Mon, 18 Mar 2019 02:41:44 +0300 Subject: [PATCH 1/3] Updated docs for manually setup react-native@0.59 --- README.md | 2 +- docs/setup-ios.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4c483800..8244184b2 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ We try our best to maintain backwards compatibility of our plugin with previous | v0.46 | v4.0+ *(RN refactored js bundle loader code)* | | v0.46-v0.53 | v5.1+ *(RN removed unused registration of JS modules)*| | v0.54-v0.55 | v5.3+ *(Android Gradle Plugin 3.x integration)* | -| v0.56-v0.57 | v5.4+ *(RN upgraded versions for Android tools)* | +| v0.56-v0.59 | v5.4+ *(RN upgraded versions for Android tools)* | We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is. diff --git a/docs/setup-ios.md b/docs/setup-ios.md index fb206e1a4..79dba3309 100644 --- a/docs/setup-ios.md +++ b/docs/setup-ios.md @@ -97,6 +97,22 @@ Once your Xcode project has been setup to build/link the CodePush plugin, you ne #import ``` +For React Native 0.59 and above: + +2. Find the following line of code, which set source URL for bridge for production releases: + + ```objective-c + return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + ``` + +3. Replace it with this line: + + ```objective-c + return [CodePush bundleURL]; + ``` + +For React Native 0.58 and below: + 2. Find the following line of code, which loads your JS Bundle from the app binary for production releases: ```objective-c From 38d98b1710aa5e22ef632e14b4e542996e49b8a2 Mon Sep 17 00:00:00 2001 From: "alexander.goncharov" Date: Mon, 18 Mar 2019 02:48:10 +0300 Subject: [PATCH 2/3] Added fixed example --- docs/setup-ios.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/setup-ios.md b/docs/setup-ios.md index 79dba3309..1163dda3d 100644 --- a/docs/setup-ios.md +++ b/docs/setup-ios.md @@ -131,7 +131,20 @@ This change configures your app to always load the most recent version of your a Typically, you're only going to want to use CodePush to resolve your JS bundle location within release builds, and therefore, we recommend using the `DEBUG` pre-processor macro to dynamically switch between using the packager server and CodePush, depending on whether you are debugging or not. This will make it much simpler to ensure you get the right behavior you want in production, while still being able to use the Chrome Dev Tools, live reload, etc. at debug-time. -For React Native 0.49 and above: +For React Native 0.59 and above: + +```objective-c +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge +{ + #if DEBUG + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; + #else + return [CodePush bundleURL]; + #endif +} +``` + +For React Native 0.49 - 0.58: ```objective-c NSURL *jsCodeLocation; From 413e9d086b14ceb8cf9532304d065147cc8f4eec Mon Sep 17 00:00:00 2001 From: Alexander Goncharov Date: Mon, 18 Mar 2019 12:27:34 +0300 Subject: [PATCH 3/3] Updated support version table --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8244184b2..1cbdae6e0 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,8 @@ We try our best to maintain backwards compatibility of our plugin with previous | v0.46 | v4.0+ *(RN refactored js bundle loader code)* | | v0.46-v0.53 | v5.1+ *(RN removed unused registration of JS modules)*| | v0.54-v0.55 | v5.3+ *(Android Gradle Plugin 3.x integration)* | -| v0.56-v0.59 | v5.4+ *(RN upgraded versions for Android tools)* | +| v0.56-v0.58 | v5.4+ *(RN upgraded versions for Android tools)* | +| v0.59 | v5.6+ *(RN refactored js bundle loader code)* | We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is.