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
Copy file name to clipboardExpand all lines: README.md
+20-20
Original file line number
Diff line number
Diff line change
@@ -102,11 +102,11 @@ In order to accommodate as many developer preferences as possible, the CodePush
102
102
```
103
103
react-native link react-native-code-push
104
104
```
105
-
105
+
106
106
If your app uses a version of React Native that is lower than v0.27, run the following:
107
107
```
108
108
rnpm link react-native-code-push
109
-
```
109
+
```
110
110
111
111
*Note: If you don't already have RNPM installed, you can do so by simply running `npm i -g rnpm` and then executing the above command. If you already have RNPM installed, make sure you have v1.9.0+ in order to benefit from this one step install.*
112
112
@@ -220,14 +220,14 @@ In order to accommodate as many developer preferences as possible, the CodePush
220
220
```
221
221
react-native link react-native-code-push
222
222
```
223
-
223
+
224
224
If your app uses a version of React Native that is lower than v0.27, run the following:
225
225
```
226
226
rnpm link react-native-code-push
227
-
```
228
-
227
+
```
228
+
229
229
*Note: If you don't already have RNPM installed, you can do so by simply running `npm i -g rnpm` and then executing the above command.*
230
-
230
+
231
231
2. If you're using RNPM >=1.6.0, you will be prompted for the deployment key you'd like to use. If you don't already have it, you can retreive this value by running `code-push deployment ls <appName> -k`, or you can choose to ignore it (by simply hitting `<ENTER>`) and add it in later. To get started, we would recommend just using your `Staging` deployment key, so that you can test out the CodePush end-to-end.
232
232
233
233
3. (Only needed in v1.8.0+ of the plugin) In your `android/app/build.gradle` file, add the `codepush.gradle` file as an additional build task definition underneath `react.gradle`:
@@ -426,13 +426,11 @@ The simplest way to do this is to "CodePush-ify" your app's root component. To d
426
426
427
427
```javascript
428
428
importcodePushfrom"react-native-code-push";
429
-
430
-
let codePushOptions;
431
-
429
+
432
430
classMyAppextendsComponent {
433
431
}
434
-
435
-
MyApp =codePush(codePushOptions)(MyApp);
432
+
433
+
MyApp =codePush(MyApp);
436
434
```
437
435
438
436
***Option 2: Use the [ES7 decorator](https://github.com/wycats/javascript-decorators) syntax:**
@@ -442,9 +440,7 @@ The simplest way to do this is to "CodePush-ify" your app's root component. To d
442
440
```javascript
443
441
import codePush from "react-native-code-push";
444
442
445
-
let codePushOptions;
446
-
447
-
@codePush(codePushOptions)
443
+
@codePush
448
444
class MyApp extends Component {
449
445
}
450
446
```
@@ -722,9 +718,13 @@ When you require `react-native-code-push`, the module object provides the follow
722
718
#### codePush
723
719
724
720
```javascript
725
-
codePush(options: CodePushOptions)(rootComponent:React.Component):React.Component; // Wrapper function
@codePush(options: CodePushOptions) // Decorator; Requires ES7 support
725
+
// Decorator; Requires ES7 support
726
+
@codePush
727
+
@codePush(options: CodePushOptions)
728
728
```
729
729
730
730
Used to wrap a React component inside a "higher order" React component that knows how to synchronize your app's JavaScript bundle and image assets when it is mounted. Internally, the higher-order component calls [`sync`](#codepushsync) inside its `componentDidMount` lifecycle handle, which in turns performs an update check, downloads the update if it exists and installs the update for you.
@@ -738,15 +738,15 @@ This decorator provides support for letting you customize its behaviour to easil
738
738
// sync with the server, without ever
739
739
// interrupting the end user
740
740
classMyAppextendsComponent {}
741
-
codePush()(MyApp);
741
+
MyApp =codePush(MyApp);
742
742
```
743
743
744
744
2. **Silent sync everytime the app resumes**. Same as 1, except we check for updates, or apply an update if one exists every time the app returns to the foreground after being "backgrounded".
3. **Interactive**. When an update is available, prompt the end user for permission before downloading it, and then immediately apply the update. If an update was released using the `mandatory` flag, the end user would still be notified about the update, but they wouldn't have the choice to ignore it.
@@ -756,7 +756,7 @@ This decorator provides support for letting you customize its behaviour to easil
4. **Log/display progress**. While the app is syncing with the server for updates, make use of the `codePushStatusDidChange` and/or `codePushDownloadDidProgress` event hooks to log down the different stages of this process, or even display a progress bar to the user.
@@ -789,7 +789,7 @@ This decorator provides support for letting you customize its behaviour to easil
789
789
console.log(progess.receivedBytes+" of "+progress.totalBytes+" received.");
0 commit comments