Skip to content

Commit 9a89c5c

Browse files
committed
docs: clearly state differences from the original
1 parent 35c7b8d commit 9a89c5c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
1+
## @bravemobile/react-native-code-push
2+
3+
Fork of `code-push-react-native`
4+
5+
```bash
6+
npm install @bravemobile/react-native-code-push
7+
```
8+
9+
You'll have more flexibility and freedom in your deployment strategy.
10+
You can still use CodePush, but become independent of AppCenter's cloud infrastructure.
11+
12+
### Self-host the update bundle file
13+
14+
Specify the host and path using the `bundleHost` option.
15+
16+
Upload the code-push bundle file to your server. The file name should be exactly same as the file on AppCenter.
17+
18+
```javascript
19+
const codePushOptions = {
20+
bundlehost: 'https://cdn.yours.com/codepush/bundle/',
21+
};
22+
23+
export default codePush(codePushOptions)(MyApp);
24+
```
25+
26+
### Customize the update check behavior
27+
28+
Specify a function to perform the update check using the `updateChecker` option.
29+
30+
(The `bundleHost` option can be used in combination.)
31+
32+
`fallbackToAppCenter` : If an error occurs during the execution of the updateChecker function, the original update check behavior is performed as a fallback. (default: true)
33+
34+
```javascript
35+
const codePushOptions = {
36+
updateChecker: async (updateCheckRequest) => {
37+
// It's up to you to decide what to do.
38+
// However, you need to have a good understanding of Code Push's interface to configure your response.
39+
const { data: response } = await axios.get('https://your.api.com/update_check', {
40+
params: { app_version: updateCheckRequest.app_version }
41+
});
42+
return response;
43+
},
44+
fallbackToAppCenter: true,
45+
};
46+
47+
export default codePush(codePushOptions)(MyApp);
48+
```
49+
50+
51+
## Original README.md is below.
52+
53+
---
54+
155
[![appcenterbanner](https://user-images.githubusercontent.com/31293287/32969262-3cc5d48a-cb99-11e7-91bf-fa57c67a371c.png)](http://microsoft.github.io/code-push/)
256

357
#### [Sign up With App Center](https://appcenter.ms/signup?utm_source=CodePush&utm_medium=Azure) to use CodePush

0 commit comments

Comments
 (0)