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 Oct 12, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
7
7
This plugin provides client-side integration for the [CodePush service](https://microsoft.github.io/code-push/), allowing you to easily add a dynamic update experience to your Cordova app(s).
@@ -18,7 +18,7 @@ This plugin provides client-side integration for the [CodePush service](https://
18
18
*[PhoneGap Build](#phonegap-build)
19
19
*[Example Apps](#example-apps)
20
20
21
-
<!-- Cordova Catelog-->
21
+
<!-- Cordova Catalog-->
22
22
23
23
## How does it work?
24
24
@@ -94,33 +94,33 @@ With the CodePush plugin installed, configure your app to use it via the followi
94
94
</platform>
95
95
```
96
96
You can use the same private/public key pair for each platform.
97
-
97
+
98
98
2. If you're using an `<accessorigin="*" />` element in your `config.xml` file, then your app is already allowed to communicate with the CodePush servers and you can safely skip this step. Otherwise, add the following additional `<access />` elements:
3. To ensure that your app can access the CodePush server on [CSP](https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Introducing_Content_Security_Policy)-compliant platforms, add `https://codepush.appcenter.ms` to the `Content-Security-Policy` `meta` tag in your `index.html` file:
4. Finally, double-check that you already have the [`cordova-plugin-whitelist`](https://github.com/apache/cordova-plugin-whitelist) plugin installed (most apps will). To check this, simply run the following command:
113
113
114
114
```shell
115
115
cordova plugin ls
116
116
```
117
-
117
+
118
118
If `cordova-plugin-whitelist` is in the list, then you are good to go. Otherwise, simply run the following command to add it:
119
-
119
+
120
120
```shell
121
121
cordova plugin add cordova-plugin-whitelist
122
122
```
123
-
123
+
124
124
You are now ready to use the plugin in the application code. See the [sample applications](/samples) for examples and the API documentation for more details.
125
125
126
126
*NOTE: There is a possibility to specify WebView engine on the plugin build phase. By default UIWebView engine is used. You can force plugin to use WKWebView by adding this iOS specific preference:*
@@ -198,7 +198,7 @@ The CodePush client supports differential updates, so even though you are releas
198
198
199
199
*NOTE: for **Ionic** apps you need to run `ionic build` before running `cordova-release` or `release` command in order to build web assets.*
200
200
201
-
For more details about how the `release-cordova` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://github.com/Microsoft/code-push/tree/master/cli#releasing-updates-cordova). Additionally, if you would prefer to handle running the `cordova prepare` command yourself, and therefore, want an even more flexible solution than `release-cordova`, refer to the [`release` command](https://github.com/Microsoft/code-push/tree/master/cli#releasing-updates-general) for more details.
201
+
For more details about how the `release-cordova` command works, as well as the various parameters it exposes, refer to the [CLI docs](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#releasing-updates-cordova). Additionally, if you would prefer to handle running the `cordova prepare` command yourself, and therefore, want an even more flexible solution than `release-cordova`, refer to the [`release` command](https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli#releasing-updates-general) for more details.
202
202
203
203
If you run into any issues, or have any questions/comments/feedback, you can [e-mail us](mailto:codepushfeed@microsoft.com) and/or open a new issue on this repo and we'll respond ASAP!
204
204
@@ -241,7 +241,7 @@ When the update check completes, it will trigger the `onUpdateCheck` callback wi
241
241
1. `null` if there is no update available. This occurs in the following scenarios:
242
242
243
243
1. The configured deployment doesn't contain any releases, and therefore, nothing to update.
244
-
244
+
245
245
2. The latest release within the configured deployment is targeting a different binary version than what you're currently running (either older or newer).
246
246
247
247
3. The currently running app already has the latest release from the configured deployment, and therefore, doesn't need it again.
@@ -281,9 +281,9 @@ When the update retrieval completes, it will trigger the `onSuccess` callback wi
281
281
1. `null` if the app is currently running the HTML start page from the binary and not a CodePush update. This occurs in the following scenarios:
282
282
283
283
1. The end-user installed the app binary and has yet to install a CodePush update
284
-
284
+
285
285
2. The end-user installed an update of the binary (e.g. from the store), which cleared away the old CodePush updates, and gave precedence back to the binary.
286
-
286
+
287
287
2. A `LocalPackage` instance which represents the metadata for the currently running CodePush update.
// If the current app "session" represents the first time
305
305
// this update has run, and it had a description provided
306
306
// with it upon release, let's show it to the end user
@@ -321,7 +321,7 @@ Gets the metadata for the currently pending update (if one exists). An update is
321
321
When the update retrieval completes, it will trigger the `onSuccess` callback with one of two possible values:
322
322
323
323
1. `null` if the app doesn't currently have a pending update (e.g. the app is already running the latest available version).
324
-
324
+
325
325
2. A `LocalPackage` instance which represents the metadata for the currently pending CodePush update.
326
326
327
327
Parameters:
@@ -387,7 +387,7 @@ Example Usage:
387
387
388
388
```javascript
389
389
// Fully silent update which keeps the app in
390
-
// sync with the server, without ever
390
+
// sync with the server, without ever
391
391
// interrupting the end user
392
392
codePush.sync();
393
393
@@ -408,7 +408,7 @@ While the sync method tries to make it easy to perform silent and active updates
408
408
- __downloadProgress__: Called periodically when an available update is being downloaded from the CodePush server. The method is called with a `DownloadProgress` object, which contains the following two properties:
409
409
410
410
- __totalBytes__ *(Number)* - The total number of bytes expected to be received for this update (i.e. the size of the set of files which changed from the previous release).
411
-
411
+
412
412
- __receivedBytes__ *(Number)* - The number of bytes downloaded thus far, which can be used to track download progress.
@@ -499,7 +499,7 @@ The `sync` method can be called anywhere you'd like to check for an update. That
499
499
500
500
### Package objects
501
501
502
-
The `checkForUpdate` and `getCurrentPackage` methods invoke success callbacks, that when triggered, provide acces to "package" objects. The package represents your code update as well as any extra metadata (e.g. description, mandatory?). The CodePush API has the distinction between the following types of packages:
502
+
The `checkForUpdate` and `getCurrentPackage` methods invoke success callbacks, that when triggered, provide access to "package" objects. The package represents your code update as well as any extra metadata (e.g. description, mandatory?). The CodePush API has the distinction between the following types of packages:
503
503
504
504
1. `LocalPackage`: Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
505
505
@@ -561,7 +561,7 @@ var onUpdateCheck = function (remotePackage) {
561
561
if (!remotePackage) {
562
562
console.log("The application is up to date.");
563
563
} else {
564
-
// The hash of each previously reverted package is stored for later use.
564
+
// The hash of each previously reverted package is stored for later use.
565
565
// This way, we avoid going into an infinite bad update/revert loop.
566
566
if (!remotePackage.failedInstall) {
567
567
console.log("A CodePush update is available. Package hash: "+remotePackage.packageHash);
@@ -667,8 +667,8 @@ Defines the possible statuses of the [sync](#codepushsync) operation. There are
667
667
- __UPDATE_INSTALLED__: An available update has been installed and will be run either immediately after the callback function returns or the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
668
668
669
669
- __UPDATE_IGNORED__: The app has an optional update, which the end user chose to ignore. *(This is only applicable when the `updateDialog` is used)*
670
-
671
-
- __ERROR__: An error occurred during the `sync` operation. This might be an error while communicating with the server, downloading or unziping the update. The console logs should contain more information about what happened. No update has been applied in this case.
670
+
671
+
- __ERROR__: An error occurred during the `sync` operation. This might be an error while communicating with the server, downloading or unzipping the update. The console logs should contain more information about what happened. No update has been applied in this case.
672
672
673
673
- __IN_PROGRESS__: Another sync is already running, so this attempt to sync has been aborted.
0 commit comments