Skip to content

Commit 43b1a87

Browse files
Change docs for [email protected] (#1545)
1 parent 14f71e3 commit 43b1a87

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ We try our best to maintain backwards compatibility of our plugin with previous
6969
| v0.46 | v4.0+ *(RN refactored js bundle loader code)* |
7070
| v0.46-v0.53 | v5.1+ *(RN removed unused registration of JS modules)*|
7171
| v0.54-v0.55 | v5.3+ *(Android Gradle Plugin 3.x integration)* |
72-
| v0.56-v0.57 | v5.4+ *(RN upgraded versions for Android tools)* |
72+
| v0.56-v0.58 | v5.4+ *(RN upgraded versions for Android tools)* |
73+
| v0.59 | v5.6+ *(RN refactored js bundle loader code)* |
7374

7475
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.
7576

docs/setup-ios.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,22 @@ Once your Xcode project has been setup to build/link the CodePush plugin, you ne
9797
#import <CodePush/CodePush.h>
9898
```
9999
100+
For React Native 0.59 and above:
101+
102+
2. Find the following line of code, which set source URL for bridge for production releases:
103+
104+
```objective-c
105+
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
106+
```
107+
108+
3. Replace it with this line:
109+
110+
```objective-c
111+
return [CodePush bundleURL];
112+
```
113+
114+
For React Native 0.58 and below:
115+
100116
2. Find the following line of code, which loads your JS Bundle from the app binary for production releases:
101117
102118
```objective-c
@@ -115,7 +131,20 @@ This change configures your app to always load the most recent version of your a
115131
116132
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.
117133
118-
For React Native 0.49 and above:
134+
For React Native 0.59 and above:
135+
136+
```objective-c
137+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
138+
{
139+
#if DEBUG
140+
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
141+
#else
142+
return [CodePush bundleURL];
143+
#endif
144+
}
145+
```
146+
147+
For React Native 0.49 - 0.58:
119148

120149
```objective-c
121150
NSURL *jsCodeLocation;

0 commit comments

Comments
 (0)