@revopush/react-native-code-push 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -13,8 +13,9 @@ This plugin provides client-side integration for the [CodePush service](https://
|
|
|
13
13
|
* [iOS Setup](docs/setup-ios.md)
|
|
14
14
|
* [Android Setup](docs/setup-android.md)
|
|
15
15
|
* [Plugin Usage](#plugin-usage)
|
|
16
|
-
* [Store Guideline Compliance](#store-guideline-compliance)
|
|
17
16
|
* [Releasing Updates](#releasing-updates)
|
|
17
|
+
* [Migrate from Appcenter to Revopush](#migrate-from-appcenter)
|
|
18
|
+
* [Continuous Integration / Delivery](#continuous-integration--delivery)
|
|
18
19
|
* [Multi-Deployment Testing](#multi-deployment-testing)
|
|
19
20
|
* [Android](docs/multi-deployment-testing-android.md)
|
|
20
21
|
* [iOS](docs/multi-deployment-testing-ios.md)
|
|
@@ -23,9 +24,8 @@ This plugin provides client-side integration for the [CodePush service](https://
|
|
|
23
24
|
* [JavaScript API](docs/api-js.md)
|
|
24
25
|
* [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
25
26
|
* [Java API Reference (Android)](docs/api-android.md)
|
|
27
|
+
* [Store Guideline Compliance](#store-guideline-compliance)
|
|
26
28
|
* [Debugging / Troubleshooting](#debugging--troubleshooting)
|
|
27
|
-
* [Example Apps / Starters](#example-apps--starters)
|
|
28
|
-
* [Continuous Integration / Delivery](#continuous-integration--delivery)
|
|
29
29
|
* [TypeScript Consumption](#typescript-consumption)
|
|
30
30
|
|
|
31
31
|
<!-- React Native Catalog -->
|
|
@@ -36,7 +36,7 @@ A React Native app is composed of JavaScript files and any accompanying [images]
|
|
|
36
36
|
|
|
37
37
|
The CodePush plugin helps get product improvements in front of your end users instantly, by keeping your JavaScript and images synchronized with updates you release to the CodePush server. This way, your app gets the benefits of an offline mobile experience, as well as the "web-like" agility of side-loading updates as soon as they are available. It's a win-win!
|
|
38
38
|
|
|
39
|
-
In order to ensure that your end users always have a functioning version of your app, the CodePush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to
|
|
39
|
+
In order to ensure that your end users always have a functioning version of your app, the CodePush plugin maintains a copy of the previous update, so that in the event that you accidentally push an update which includes a crash, it can automatically roll back. This way, you can rest assured that your newfound release agility won't result in users becoming blocked before you have a chance to roll back on the server. It's a win-win-win!
|
|
40
40
|
|
|
41
41
|
*Note: Any product changes which touch native code (e.g. modifying your `AppDelegate.m`/`MainActivity.java` file, adding a new plugin) cannot be distributed via CodePush, and therefore, must be updated via the appropriate store(s).*
|
|
42
42
|
|
|
@@ -93,8 +93,6 @@ npm install --save @revopush/react-native-code-push
|
|
|
93
93
|
|
|
94
94
|
As with all other React Native plugins, the integration experience is different for iOS and Android, so perform the following setup steps depending on which platform(s) you are targeting. Note, if you are targeting both platforms it is recommended to create separate CodePush applications for each platform.
|
|
95
95
|
|
|
96
|
-
If you want to see how other projects have integrated with CodePush, you can check out the excellent [example apps](#example-apps--starters) provided by the community.
|
|
97
|
-
|
|
98
96
|
*NOTE: This guide assumes you have used the `@react-native-community/cli init` command to initialize your React Native project.*
|
|
99
97
|
|
|
100
98
|
Then continue with installing the native module
|
|
@@ -217,89 +215,83 @@ If you would like to display an update confirmation dialog (an "active install")
|
|
|
217
215
|
|
|
218
216
|
*NOTE: If you are using [Redux](http://redux.js.org) and [Redux Saga](https://redux-saga.js.org/), you can alternatively use the [react-native-code-push-saga](http://github.com/lostintangent/react-native-code-push-saga) module, which allows you to customize when `sync` is called in a perhaps simpler/more idiomatic way.*
|
|
219
217
|
|
|
220
|
-
### Store Guideline Compliance
|
|
221
|
-
|
|
222
|
-
Android Google Play and iOS App Store have corresponding guidelines that have rules you should be aware of before integrating the CodePush solution within your application.
|
|
223
|
-
|
|
224
|
-
#### Google play
|
|
225
|
-
|
|
226
|
-
Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describe that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction does not apply to updating javascript bundles.
|
|
227
|
-
> This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser).
|
|
228
|
-
|
|
229
|
-
That fully allow CodePush as it updates just JS bundles and can't update native code part.
|
|
230
|
-
|
|
231
|
-
#### App Store
|
|
232
|
-
|
|
233
|
-
Paragraph **3.3.2**, since back in 2015's [Apple Developer Program License Agreement](https://developer.apple.com/programs/ios/information/) fully allowed performing over-the-air updates of JavaScript and assets - and in its latest version (20170605) [downloadable here](https://developer.apple.com/terms/) this ruling is even broader:
|
|
234
|
-
|
|
235
|
-
> Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS.
|
|
236
|
-
|
|
237
|
-
CodePush allows you to follow these rules in full compliance so long as the update you push does not significantly deviate your product from its original App Store approved intent.
|
|
238
|
-
|
|
239
|
-
To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the `updateDialog` option when calling `sync`, since in the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) it is written that:
|
|
240
|
-
|
|
241
|
-
> Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
|
|
242
|
-
|
|
243
|
-
This is not necessarily the case for `updateDialog`, since it won't force the user to download the new version, but at least you should be aware of that ruling if you decide to show it.
|
|
244
|
-
|
|
245
218
|
## Releasing Updates
|
|
246
219
|
|
|
247
220
|
Once your app is configured and distributed to your users, and you have made some JS or asset changes, it's time to release them. The recommended way to release them is using the `release-react` command in the App Center CLI, which will bundle your JavaScript files, asset files, and release the update to the CodePush server.
|
|
248
221
|
|
|
249
|
-
|
|
222
|
+
```shell
|
|
223
|
+
npm install -g @revopush/code-push-cli
|
|
224
|
+
```
|
|
250
225
|
|
|
251
|
-
|
|
226
|
+
*NOTE: Before you can start releasing updates, please log into Revopush by running the `revopush login` command.*
|
|
252
227
|
|
|
253
|
-
|
|
254
|
-
revopush release-react -a <ownerName>/<appName>
|
|
228
|
+
In its most basic form, this command only requires application name and platform (ios/android) .
|
|
255
229
|
|
|
256
|
-
|
|
257
|
-
revopush release-react
|
|
230
|
+
```shell
|
|
231
|
+
revopush release-react <appName> <platform ios/android>
|
|
232
|
+
revopush release-react MyApp android -d Production
|
|
233
|
+
release-react MyApp ios
|
|
258
234
|
```
|
|
259
235
|
|
|
260
236
|
The `release-react` command enables such a simple workflow because it provides many sensible defaults (like generating a release bundle, assuming your app's entry file on iOS is either `index.ios.js` or `index.js`). However, all of these defaults can be customized to allow incremental flexibility as necessary, which makes it a good fit for most scenarios.
|
|
261
237
|
|
|
262
238
|
```shell
|
|
263
239
|
# Release a mandatory update with a changelog
|
|
264
|
-
revopush release-react
|
|
240
|
+
revopush release-react MyApp ios -m --description "Modified the header color"
|
|
265
241
|
|
|
266
242
|
# Release an update for an app that uses a non-standard entry file name, and also capture
|
|
267
243
|
# the sourcemap file generated by react-native bundle
|
|
268
|
-
revopush release-react
|
|
244
|
+
revopush release-react MyApp ios --entry-file MyApp.js --sourcemapOutput ../maps/MyApp.map
|
|
269
245
|
|
|
270
246
|
# Release a dev Android build to just 1/4 of your end users
|
|
271
|
-
revopush release-react
|
|
247
|
+
revopush release-react MyApp android --rollout 25 --development true
|
|
272
248
|
|
|
273
249
|
# Release an update that targets users running any 1.1.* binary, as opposed to
|
|
274
250
|
# limiting the update to exact version name in the build.gradle file
|
|
275
|
-
revopush release-react
|
|
251
|
+
revopush release-react MyApp android --targetBinaryVersion "~1.1.0"
|
|
276
252
|
```
|
|
277
253
|
|
|
278
|
-
The CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps and we can worry about optimizing end user downloads.
|
|
254
|
+
The CodePush client supports differential updates, so even though you are releasing your JS bundle and assets on every update, your end users will only actually download the files they need. The service handles this automatically so that you can focus on creating awesome apps, and we can worry about optimizing end user downloads.
|
|
279
255
|
|
|
280
|
-
For more details about how the `release-react` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://github.com/
|
|
256
|
+
For more details about how the `release-react` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://github.com/revopush/code-push-cli/blob/main/README.md). Additionally, if you would prefer to handle running the `react-native bundle` command yourself, and therefore, want an even more flexible solution than `release-react`, refer to the [`release` command](https://github.com/microsoft/code-push/tree/v3.0.1/cli#releasing-updates-general) for more details.
|
|
281
257
|
|
|
282
|
-
If you run into any issues, or have any questions/comments/feedback,
|
|
258
|
+
If you run into any issues, or have any questions/comments/feedback, [e-mail us](mailto:support@revopush.org) and/or check out the [troubleshooting](#debugging--troubleshooting) details below.
|
|
283
259
|
|
|
284
260
|
*NOTE: CodePush updates should be tested in modes other than Debug mode. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply.*
|
|
285
261
|
|
|
262
|
+
### Migrate from Appcenter to Revopush
|
|
263
|
+
|
|
264
|
+
Follow our [comprehensive guide](https://github.com/revopush/code-push-cli/blob/main/README.md) that will help you migrate your applications from App Center.
|
|
265
|
+
|
|
266
|
+
### Continuous Integration / Delivery
|
|
267
|
+
|
|
268
|
+
In addition to being able to use the CodePush CLI to "manually" release updates, we believe that it's important to create a repeatable and sustainable solution for continuously delivering updates to your app.
|
|
269
|
+
That way, it's simple enough for you and/or your team to create and maintain the rhythm of performing agile deployments.
|
|
270
|
+
In order to assist with setting up a CodePush-based CD pipeline, refer to the following integrations with various CI servers:
|
|
271
|
+
|
|
272
|
+
* [Github Actions](https://github.com/revopush/revopush-github-action) - supports all the commands available in the Revopush CLI of appropriate version
|
|
273
|
+
* [Bitrise Step](https://github.com/revopush/bitrise-steplib)
|
|
274
|
+
* [Circle CI Orb](https://github.com/revopush/revopush-circleci-orb)
|
|
275
|
+
|
|
276
|
+
Additionally, if you'd like more integrations, please message us at [support@revopush.org](mailto:support@revopush.org)
|
|
277
|
+
|
|
286
278
|
### Multi-Deployment Testing
|
|
287
279
|
|
|
288
280
|
In our [getting started](#getting-started) docs, we illustrated how to configure the CodePush plugin using a specific deployment key. However, in order to effectively test your releases, it is critical that you leverage the `Staging` and `Production` deployments that are auto-generated when you first created your CodePush app (or any custom deployments you may have created). This way, you never release an update to your end users that you haven't been able to validate yourself.
|
|
289
281
|
|
|
290
|
-
*NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks (i.e. `
|
|
282
|
+
*NOTE: Our client-side rollback feature can help unblock users after installing a release that resulted in a crash, and server-side rollbacks (i.e. `revopush rollback`) allow you to prevent additional users from installing a bad release once it's been identified. However, it's obviously better if you can prevent an erroneous update from being broadly released in the first place.*
|
|
291
283
|
|
|
292
284
|
Taking advantage of the `Staging` and `Production` deployments allows you to achieve a workflow like the following (feel free to customize!):
|
|
293
285
|
|
|
294
|
-
1. Release a CodePush update to your `Staging` deployment using the `
|
|
286
|
+
1. Release a CodePush update to your `Staging` deployment using the `revopush release-react` command (or `revopush release` if you need more control)
|
|
295
287
|
|
|
296
288
|
2. Run your staging/beta build of your app, sync the update from the server, and verify it works as expected
|
|
297
289
|
|
|
298
|
-
3. Promote the tested release from `Staging` to `Production` using the `
|
|
290
|
+
3. Promote the tested release from `Staging` to `Production` using the `revopush promote` command
|
|
299
291
|
|
|
300
292
|
4. Run your production/release build of your app, sync the update from the server and verify it works as expected
|
|
301
293
|
|
|
302
|
-
*NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `
|
|
294
|
+
*NOTE: If you want to take a more cautious approach, you can even choose to perform a "staged rollout" as part of #3, which allows you to mitigate additional potential risk with the update (like did your testing in #2 touch all possible devices/conditions?) by only making the production update available to a percentage of your users (for example `revopush promote <appName> Staging Production -r 20`). Then, after waiting for a reasonable amount of time to see if any crash reports or customer feedback comes in, you can expand it to your entire audience by running `revopush patch <appName> Production -r 100`.*
|
|
303
295
|
|
|
304
296
|
You'll notice that the above steps refer to a "staging build" and "production build" of your app. If your build process already generates distinct binaries per "environment", then you don't need to read any further, since swapping out CodePush deployment keys is just like handling environment-specific config for any other service your app uses (like Facebook). However, if you're looking for examples (**including demo projects**) on how to setup your build process to accommodate this, then refer to the following sections, depending on the platform(s) your app is targeting:
|
|
305
297
|
|
|
@@ -327,14 +319,14 @@ With that change in place, now it's just a matter of choosing how your app deter
|
|
|
327
319
|
|
|
328
320
|
*NOTE: If needed, you could also implement a hybrid solution that allowed your end-users to toggle between different deployments, while also allowing your server to override that decision. This way, you have a hierarchy of "deployment resolution" that ensures your app has the ability to update itself out-of-the-box, your end users can feel rewarded by getting early access to bits, but you also have the ability to run A/B tests on your users as needed.*
|
|
329
321
|
|
|
330
|
-
Since we recommend using the `Staging` deployment for pre-release testing of your updates (as explained in the previous section), it doesn't
|
|
322
|
+
Since we recommend using the `Staging` deployment for pre-release testing of your updates (as explained in the previous section), it doesn't necessarily make sense to use it for performing A/B tests on your users, as opposed to allowing early-access (as explained in option #1 above). Therefore, we recommend making full use of custom app deployments, so that you can segment your users however makes sense for your needs. For example, you could create long-term or even one-off deployments, release a variant of your app to it, and then place certain users into it in order to see how they engage.
|
|
331
323
|
|
|
332
324
|
```javascript
|
|
333
325
|
// #1) Create your new deployment to hold releases of a specific app variant
|
|
334
|
-
|
|
326
|
+
revopush deployment add MyApp test-variant-one
|
|
335
327
|
|
|
336
328
|
// #2) Target any new releases at that custom deployment
|
|
337
|
-
|
|
329
|
+
revopush release-react MyApp android -d test-variant-one
|
|
338
330
|
```
|
|
339
331
|
|
|
340
332
|
*NOTE: The total user count that is reported in your deployment's "Install Metrics" will take into account users that have "switched" from one deployment to another. For example, if your `Production` deployment currently reports having 1 total user, but you dynamically switch that user to `Staging`, then the `Production` deployment would report 0 total users, while `Staging` would report 1 (the user that just switched). This behavior allows you to accurately track your release adoption, even in the event of using a runtime-based deployment redirection solution.*
|
|
@@ -347,24 +339,34 @@ appcenter codepush release-react -a <ownerName>/<appName> -d test-variant-one
|
|
|
347
339
|
* [Objective-C API Reference (iOS)](docs/api-ios.md)
|
|
348
340
|
* [Java API Reference (Android)](docs/api-android.md)
|
|
349
341
|
|
|
350
|
-
###
|
|
342
|
+
### Store Guideline Compliance
|
|
343
|
+
|
|
344
|
+
Android Google Play and iOS App Store have corresponding guidelines that have rules you should be aware of before integrating the CodePush solution within your application.
|
|
345
|
+
|
|
346
|
+
#### Google play
|
|
347
|
+
|
|
348
|
+
Third paragraph of [Device and Network Abuse](https://support.google.com/googleplay/android-developer/answer/9888379?hl=en) topic describe that updating source code by any method other than Google Play's update mechanism is restricted. But this restriction does not apply to updating javascript bundles.
|
|
349
|
+
> This restriction does not apply to code that runs in a virtual machine and has limited access to Android APIs (such as JavaScript in a webview or browser).
|
|
350
|
+
|
|
351
|
+
That fully allow CodePush as it updates just JS bundles and can't update native code part.
|
|
352
|
+
|
|
353
|
+
#### App Store
|
|
354
|
+
|
|
355
|
+
Paragraph **3.3.2**, since back in 2015's [Apple Developer Program License Agreement](https://developer.apple.com/programs/ios/information/) fully allowed performing over-the-air updates of JavaScript and assets - and in its latest version (20170605) [downloadable here](https://developer.apple.com/terms/) this ruling is even broader:
|
|
351
356
|
|
|
352
|
-
|
|
357
|
+
> Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS.
|
|
353
358
|
|
|
354
|
-
|
|
355
|
-
* [Feline for Product Hunt](https://github.com/arjunkomath/Feline-for-Product-Hunt) - An Android client for Product Hunt.
|
|
356
|
-
* [GeoEncoding](https://github.com/LynxITDigital/GeoEncoding) - An app by [Lynx IT Digital](https://digital.lynxit.com.au) which demonstrates how to use numerous React Native components and modules.
|
|
357
|
-
* [Math Facts](https://github.com/Khan/math-facts) - An app by Khan Academy to help memorize math facts more easily.
|
|
359
|
+
CodePush allows you to follow these rules in full compliance so long as the update you push does not significantly deviate your product from its original App Store approved intent.
|
|
358
360
|
|
|
359
|
-
|
|
361
|
+
To further remain in compliance with Apple's guidelines we suggest that App Store-distributed apps don't enable the `updateDialog` option when calling `sync`, since in the [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) it is written that:
|
|
360
362
|
|
|
361
|
-
|
|
363
|
+
> Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
|
|
362
364
|
|
|
363
|
-
|
|
365
|
+
This is not necessarily the case for `updateDialog`, since it won't force the user to download the new version, but at least you should be aware of that ruling if you decide to show it.
|
|
364
366
|
|
|
365
367
|
### Debugging / Troubleshooting
|
|
366
368
|
|
|
367
|
-
The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc. We want to continue improving the logging to be as intuitive/comprehensive as possible, so please [let us know](mailto:
|
|
369
|
+
The `sync` method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when using it, the best thing to try first is examining the output logs of your app. This will tell you whether the app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc. We want to continue improving the logging to be as intuitive/comprehensive as possible, so please [let us know](mailto:support@revopush.org) if you find it to be confusing or missing anything.
|
|
368
370
|
|
|
369
371
|
The simplest way to view these logs is to add the flag `--debug` for each command. This will output a log stream that is filtered to just CodePush messages. This makes it easy to identify issues, without needing to use a platform-specific tool, or wade through a potentially high volume of logs.
|
|
370
372
|
|
|
@@ -395,19 +397,8 @@ Now you'll be able to see CodePush logs in either debug or release mode, on both
|
|
|
395
397
|
| I've released new update but changes are not reflected | Be sure that you are running app in modes other than Debug. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by CodePush does not apply.
|
|
396
398
|
| No JS bundle is being found when running your app against the iOS simulator | By default, React Native doesn't generate your JS bundle when running against the simulator. Therefore, if you're using `[CodePush bundleURL]`, and targetting the iOS simulator, you may be getting a `nil` result. This issue will be fixed in RN 0.22.0, but only for release builds. You can unblock this scenario right now by making [this change](https://github.com/facebook/react-native/commit/9ae3714f4bebdd2bcab4d7fdbf23acebdc5ed2ba) locally.
|
|
397
399
|
|
|
398
|
-
### Continuous Integration / Delivery
|
|
399
|
-
|
|
400
|
-
In addition to being able to use the CodePush CLI to "manually" release updates, we believe that it's important to create a repeatable and sustainable solution for contiously delivering updates to your app. That way, it's simple enough for you and/or your team to create and maintain the rhythm of performing agile deployments. In order to assist with setting up a CodePush-based CD pipeline, refer to the following integrations with various CI servers:
|
|
401
|
-
|
|
402
|
-
* [Visual Studio Team Services](https://marketplace.visualstudio.com/items?itemName=ms-vsclient.code-push) - *NOTE: VSTS also has extensions for publishing to [HockeyApp](https://marketplace.visualstudio.com/items?itemName=ms.hockeyapp) and the [Google Play](https://github.com/microsoft/google-play-vsts-extension) store, so it provides a pretty great mobile CD solution in general.*
|
|
403
|
-
* [Travis CI](https://github.com/mondora/code-push-travis-cli)
|
|
404
|
-
|
|
405
|
-
Additionally, if you'd like more details of what a complete mobile CI/CD workflow can look like, which includes CodePush, check out this [excellent article](https://medium.com/zeemee-engineering/zeemee-engineering-and-the-quest-for-the-holy-mobile-dev-grail-1310be4953d1) by the [ZeeMee engineering team](https://www.zeemee.com/).
|
|
406
|
-
|
|
407
400
|
### TypeScript Consumption
|
|
408
401
|
|
|
409
402
|
This module ships its `*.d.ts` file as part of its NPM package, which allows you to simply `import` it, and receive intellisense in supporting editors (like Visual Studio Code), as well as compile-time type checking if you're using TypeScript. For the most part, this behavior should just work out of the box, however, if you've specified `es6` as the value for either the `target` or `module` [compiler option](http://www.typescriptlang.org/docs/handbook/compiler-options.html) in your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file, then just make sure that you also set the `moduleResolution` option to `node`. This ensures that the TypeScript compiler will look within the `node_modules` for the type definitions of imported modules. Otherwise, you'll get an error like the following when trying to import the `react-native-code-push` module: `error TS2307: Cannot find module 'react-native-code-push'`.
|
|
410
403
|
|
|
411
404
|
---
|
|
412
|
-
|
|
413
|
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
package/docs/api-android.md
CHANGED
|
@@ -10,7 +10,7 @@ Since `autolinking` uses `react-native.config.js` to link plugins, constructors
|
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
- **Server Url** - used for specifying CodePush Server Url.
|
|
13
|
-
The Default value: "https://api.revopush.org
|
|
13
|
+
The Default value: "https://api.revopush.org" is overridden by adding your path to `strings.xml` with name `CodePushServerUrl`. CodePush automatically gets this property and will use this path to send requests. For example:
|
|
14
14
|
```xml
|
|
15
15
|
<string moduleConfig="true" name="CodePushServerUrl">https://api.revopush.org</string>
|
|
16
16
|
```
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
The [Android Gradle plugin](https://google.github.io/android-gradle-dsl/current/index.html) allows you to define custom config settings for each "build type" (like debug, release). This mechanism allows you to easily configure your debug builds to use your CodePush staging deployment key and your release builds to use your CodePush production deployment key.
|
|
8
8
|
|
|
9
|
-
*NOTE: As a reminder, you can retrieve these keys by running `
|
|
9
|
+
*NOTE: As a reminder, you can retrieve these keys by running ` revopush deployment ls <appName> -k` from your terminal.*
|
|
10
10
|
|
|
11
11
|
To set this up, perform the following steps:
|
|
12
12
|
|
|
@@ -44,7 +44,7 @@ To set this up, perform the following steps:
|
|
|
44
44
|
|
|
45
45
|

|
|
46
46
|
|
|
47
|
-
*NOTE: As a reminder, you can retrieve these keys by running `
|
|
47
|
+
*NOTE: As a reminder, you can retrieve these keys by running `revopush deployment ls <appName> -k` from your terminal.*
|
|
48
48
|
|
|
49
49
|
9. Open your project's `Info.plist` file and change the value of your `CodePushDeploymentKey` entry to `$(CODEPUSH_KEY)`
|
|
50
50
|
|
package/docs/setup-android.md
CHANGED
|
@@ -48,13 +48,18 @@ In order to integrate CodePush into your Android project, please perform the fol
|
|
|
48
48
|
|
|
49
49
|
3. Add the Deployment key to `strings.xml`:
|
|
50
50
|
|
|
51
|
-
To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and
|
|
51
|
+
To let the CodePush runtime know which deployment it should query for updates, open your app's `strings.xml` file and
|
|
52
|
+
add a new string named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure this app against
|
|
53
|
+
(like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `revopush deployment ls <appName> -k`
|
|
54
|
+
in the Revopush CLI (the `-k` or `--displayKeys` flag is necessary since keys aren't displayed by default) or take in [Revopush UI](https://app.revopush.org/applications)
|
|
55
|
+
and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work.
|
|
56
|
+
The "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.
|
|
52
57
|
|
|
53
58
|

|
|
54
59
|
|
|
55
60
|
In order to effectively make use of the `Staging` and `Production` deployments that were created along with your CodePush app, refer to the [multi-deployment testing](../README.md#multi-deployment-testing) docs below before actually moving your app's usage of CodePush into production.
|
|
56
61
|
|
|
57
|
-
Your `strings.xml` should
|
|
62
|
+
Your `strings.xml` should look like this:
|
|
58
63
|
|
|
59
64
|
```xml
|
|
60
65
|
<resources>
|
|
@@ -72,9 +77,10 @@ In order to effectively make use of the `Staging` and `Production` deployments t
|
|
|
72
77
|
|
|
73
78
|
### Code Signing setup
|
|
74
79
|
|
|
75
|
-
|
|
80
|
+
You can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to [relevant code-push documentation section](https://github.com/microsoft/code-push/tree/v3.0.1/cli#code-signing).
|
|
81
|
+
In order to use Public Key for Code Signing you need to do following steps:
|
|
76
82
|
|
|
77
|
-
Add `CodePushPublicKey` string item to `/path_to_your_app/android/app/src/main/res/values/strings.xml`. It may
|
|
83
|
+
Add `CodePushPublicKey` string item to `/path_to_your_app/android/app/src/main/res/values/strings.xml`. It may look like this:
|
|
78
84
|
|
|
79
85
|
```xml
|
|
80
86
|
<resources>
|
package/docs/setup-ios.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
## iOS Setup
|
|
2
2
|
|
|
3
3
|
Once you've acquired the CodePush plugin, you need to integrate it into the Xcode project of your React Native app and configure it correctly. To do this, take the following steps:
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
### Plugin Installation and Configuration for React Native 0.76 version and above (iOS)
|
|
6
6
|
|
|
7
7
|
1. Run `cd ios && pod install && cd ..` to install all the necessary CocoaPods dependencies.
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
2. Change bundleUrl on AppDelegate file.
|
|
10
10
|
|
|
11
11
|
**If you're using objective-c:**
|
|
@@ -73,7 +73,10 @@ Once you've acquired the CodePush plugin, you need to integrate it into the Xcod
|
|
|
73
73
|
|
|
74
74
|
4. Add the Deployment key to `Info.plist`:
|
|
75
75
|
|
|
76
|
-
To let the CodePush runtime know which deployment it should query for updates against, open your app's `Info.plist`
|
|
76
|
+
To let the CodePush runtime know which deployment it should query for updates against, open your app's `Info.plist`
|
|
77
|
+
file and add a new entry named `CodePushDeploymentKey`, whose value is the key of the deployment you want to configure
|
|
78
|
+
this app against (like the key for the `Staging` deployment for the `FooBar` app). You can retrieve this value by running `revopush deployment ls <appName> -k` in the Revopush CLI (the `-k` or `--displayKeys` flag is necessary since keys aren't displayed by default) or take in [Revopush UI](https://app.revopush.org/applications) and copying the value of the `Key` column which corresponds to the deployment you want to use (see below). Note that using the deployment's name (like Staging) will not work.
|
|
79
|
+
That "friendly name" is intended only for authenticated management usage from the CLI, and not for public consumption within your app.
|
|
77
80
|
|
|
78
81
|

|
|
79
82
|
|
|
@@ -116,7 +119,7 @@ Before doing anything, please [read the docs][ats] first.
|
|
|
116
119
|
|
|
117
120
|
### Code Signing setup
|
|
118
121
|
|
|
119
|
-
|
|
122
|
+
You can self sign bundles during release and verify its signature before installation of update. For more info about Code Signing please refer to [relevant code-push documentation section](https://github.com/microsoft/code-push/tree/v3.0.1/cli#code-signing).
|
|
120
123
|
|
|
121
124
|
In order to configure Public Key for bundle verification you need to add record in `Info.plist` with name `CodePushPublicKey` and string value of public key content. Example:
|
|
122
125
|
|