Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit c38231e

Browse files
committed
Fixing numbers
1 parent 188df1c commit c38231e

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,38 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod
4040
1. Open your app's Xcode project
4141
2. Find the `CodePush.xcodeproj` file witin the `node_modules/react-native-code-push` directory, and drag it into the `Libraries` node in Xcode
4242

43-
![Add CodePush to project](https://cloud.githubusercontent.com/assets/516559/10322414/7688748e-6c32-11e5-83c1-00d3e6758df4.png)
43+
![Add CodePush to project](https://cloud.githubusercontent.com/assets/516559/10322414/7688748e-6c32-11e5-83c1-00d3e6758df4.png)
4444

4545
3. Select the project node in Xcode and select the "Build Phases" tab of your project configuration.
4646
4. Drag `libCodePush.a` from `Libraries/CodePush.xcodeproj/Products` into the "Link Binary With Libraries" secton of your project's "Build Phases" configuration.
4747

48-
![Link CodePush during build](https://cloud.githubusercontent.com/assets/516559/10322221/a75ea066-6c31-11e5-9d88-ff6f6a4d6968.png)
48+
![Link CodePush during build](https://cloud.githubusercontent.com/assets/516559/10322221/a75ea066-6c31-11e5-9d88-ff6f6a4d6968.png)
4949

5050
5. Under the "Build Settings" tab of your project configuration, find the "Header Search Paths" section and edit the value.
5151
Add a new value, `$(SRCROOT)/../node_modules/react-native-code-push` and select "recursive" in the dropdown.
5252

53-
![Add CodePush library reference](https://cloud.githubusercontent.com/assets/516559/10322038/b8157962-6c30-11e5-9264-494d65fd2626.png)
53+
![Add CodePush library reference](https://cloud.githubusercontent.com/assets/516559/10322038/b8157962-6c30-11e5-9264-494d65fd2626.png)
5454

5555
## Plugin Configuration
5656

5757
Once your Xcode project has been setup to build/link the CodePush plugin, you need to configure your app to consult CodePush for the location of your JS bundle, since it will "take control" of managing the current and all future versions. To do this, perform the following steps:
5858

5959
1. Open up the `AppDelegate.m` file, and add an import statement for the CodePush headers:
6060

61-
```
62-
#import "CodePush.h"
63-
```
61+
```
62+
#import "CodePush.h"
63+
```
6464
6565
2. Find the following line of code, which loads your JS Bundle from the packager's dev server:
6666
67-
```
68-
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
69-
```
67+
```
68+
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
69+
```
7070
3. Replace it with this line:
7171
72-
```
73-
jsCodeLocation = [CodePush getBundleUrl];
74-
```
72+
```
73+
jsCodeLocation = [CodePush getBundleUrl];
74+
```
7575
7676
This change configures your app to always load the most recent version of your app's JS bundle. On the initial launch, this will correspond to the file that was compiled with the app. However, after an update has been pushed via CodePush, this will return the location of the most recently applied update.
7777
@@ -92,15 +92,15 @@ The simplest way to do this is to perform the following in your app's root compo
9292
9393
1. Import the JavaScript module for CodePush:
9494
95-
```
96-
var CodePush = require("react-native-code-push")
97-
```
95+
```
96+
var CodePush = require("react-native-code-push")
97+
```
9898
9999
2. Call the `sync` method from within the `componentDidMount` lifecycle event, to initiate a background update on each app start:
100100
101-
```
102-
CodePush.sync();
103-
```
101+
```
102+
CodePush.sync();
103+
```
104104
105105
If an update is available, a dialog will be display to the user asking them if they would like to install it. If the update was marked as mandatory, then the dialog will
106106
omit the option to decline installation.
@@ -173,13 +173,14 @@ codePush.notifyApplicationReady(): Promise<void>;
173173

174174
#### codePush.sync
175175

176-
Provides a simple option for checking for an update, downloading it and then applying it, all while also respecting the policy that your release was published with. This method effectively composes together the "manual mode" APIs for you, so that you don't need to handle any of the following scenarios yourself:
176+
Provides a simple option for checking for an update, downloading it and then applying it, all while also respecting the policy that your release was published with. This method effectively composes together the "advanced mode" APIs for you, so that you don't need to handle any of the following scenarios yourself:
177177

178178
1. Checking for an update and displaying a standard confirmation dialog asking if they would like to install it
179179
2. Automatically ignoring updates which have previously failed to apply (due to automatic rollback), and therefore, likely don't make sense trying to apply again (let's blacklist them!)
180180
3. Looking to see whether an available update is mandatory, and if so, don't give the end-user the choice to ignore it
181181
4. Displaying the description of an update to the end-user as part of the install confirmation experience
182182

183+
If you want to pivot whether you check and/or download an available update based on the end-user's device battery level, network conditions, etc. then simply wrap the call to `sync` in a condition that ensures you only call it when desired.
183184
```javascript
184185
codePush.sync(options: Object): Promise<Boolean>
185186
```
@@ -254,6 +255,8 @@ The `RemotePackage` inherits all of the same properties as the `LocalPackage`, b
254255
##### Methods
255256
- __download(): Promise<LocalPackage>__: Downloads the package update from the CodePush service. Returns a Promise that resolves with the `LocalPackage`.
256257

258+
---
259+
257260
## Running the Example
258261

259262
* Clone this repository
@@ -265,8 +268,7 @@ The `RemotePackage` inherits all of the same properties as the `LocalPackage`, b
265268
* Open `CodePushDemoApp.xcodeproj` in Xcode
266269
* Launch the project
267270

268-
Running Tests
269-
---
271+
## Running Tests
270272

271273
* Open `CodePushDemoApp.xcodeproj` in Xcode
272274
* Navigate to the test explorer (small grey diamond near top left)

0 commit comments

Comments
 (0)