mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-19 02:41:14 +08:00
Merge branch 'master' of https://github.com/Microsoft/react-native-code-push
This commit is contained in:
@@ -109,6 +109,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:
|
||||
|
||||
```objective-c
|
||||
NSURL *jsCodeLocation;
|
||||
|
||||
#ifdef DEBUG
|
||||
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios&dev=true"];
|
||||
#else
|
||||
jsCodeLocation = [CodePush bundleURL];
|
||||
#endif
|
||||
```
|
||||
|
||||
For React Native 0.48 and below:
|
||||
|
||||
```objective-c
|
||||
NSURL *jsCodeLocation;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user