You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ In order to ensure that your end users always have a functioning version of your
40
40
41
41
Once you've followed the general-purpose ["getting started"](http://codepush.tools/docs/getting-started.html) instructions for setting up your CodePush account, you can start CodePush-ifying your React Native app by running the following command from within your app's root directory:
42
42
43
-
```
43
+
```shell
44
44
npm install --save react-native-code-push
45
45
```
46
46
@@ -79,19 +79,19 @@ Once your Xcode project has been setup to build/link the CodePush plugin, you ne
79
79
80
80
1. Open up the `AppDelegate.m` file, and add an import statement for the CodePush headers:
81
81
82
-
```
82
+
```objective-c
83
83
#import"CodePush.h"
84
84
```
85
85
86
86
2. Find the following line of code, which loads your JS Bundle from the app binary for production releases:
@@ -101,7 +101,7 @@ This change configures your app to always load the most recent version of your a
101
101
102
102
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.
103
103
104
-
```
104
+
```objective-c
105
105
NSURL *jsCodeLocation;
106
106
107
107
#ifdef DEBUG
@@ -207,13 +207,13 @@ The simplest way to do this is to perform the following in your app's root compo
207
207
208
208
1. Import the JavaScript module for CodePush:
209
209
210
-
```
210
+
```javascript
211
211
import CodePush from "react-native-code-push";
212
212
```
213
213
214
214
2. Call the `sync` method from within the `componentDidMount` lifecycle event, to initiate a background update on each app start:
215
215
216
-
```
216
+
```javascript
217
217
CodePush.sync();
218
218
```
219
219
@@ -231,7 +231,7 @@ Once your app has been configured and distributed to your users, and you've made
@@ -250,7 +250,7 @@ If you are using the new React Native [assets system](https://facebook.github.io
250
250
251
251
2. When calling `react-native bundle`, specify that your assets and JS bundle go into the directory you created in #1, and that you want a non-dev build for your respective platform and entry file. For example, assuming you called this directory "release", you could run the following command:
0 commit comments