Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 29feb6f

Browse files
author
Igor Krasavin
authored
Fix typo and change links (#645)
1 parent 83a9fed commit 29feb6f

3 files changed

Lines changed: 66 additions & 49 deletions

File tree

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
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).
88

9-
<!-- Cordova Catelog -->
9+
<!-- Cordova Catalog -->
1010

1111
* [How does it work?](#how-does-it-work)
1212
* [Supported Cordova Platforms](#supported-cordova-platforms)
@@ -18,7 +18,7 @@ This plugin provides client-side integration for the [CodePush service](https://
1818
* [PhoneGap Build](#phonegap-build)
1919
* [Example Apps](#example-apps)
2020

21-
<!-- Cordova Catelog -->
21+
<!-- Cordova Catalog -->
2222

2323
## How does it work?
2424

@@ -94,33 +94,33 @@ With the CodePush plugin installed, configure your app to use it via the followi
9494
</platform>
9595
```
9696
You can use the same private/public key pair for each platform.
97-
97+
9898
2. If you're using an `<access origin="*" />` 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:
99-
99+
100100
```xml
101101
<access origin="https://codepush.appcenter.ms" />
102102
<access origin="https://codepush.blob.core.windows.net" />
103103
<access origin="https://codepushupdates.azureedge.net" />
104104
```
105-
105+
106106
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:
107-
107+
108108
```xml
109109
<meta http-equiv="Content-Security-Policy" content="default-src https://codepush.appcenter.ms 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
110110
```
111-
111+
112112
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:
113113

114114
```shell
115115
cordova plugin ls
116116
```
117-
117+
118118
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+
120120
```shell
121121
cordova plugin add cordova-plugin-whitelist
122122
```
123-
123+
124124
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.
125125

126126
*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
198198

199199
*NOTE: for **Ionic** apps you need to run `ionic build` before running `cordova-release` or `release` command in order to build web assets.*
200200

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.
202202

203203
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!
204204

@@ -241,7 +241,7 @@ When the update check completes, it will trigger the `onUpdateCheck` callback wi
241241
1. `null` if there is no update available. This occurs in the following scenarios:
242242
243243
1. The configured deployment doesn't contain any releases, and therefore, nothing to update.
244-
244+
245245
2. The latest release within the configured deployment is targeting a different binary version than what you're currently running (either older or newer).
246246
247247
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
281281
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:
282282
283283
1. The end-user installed the app binary and has yet to install a CodePush update
284-
284+
285285
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+
287287
2. A `LocalPackage` instance which represents the metadata for the currently running CodePush update.
288288
289289
Parameters:
@@ -300,7 +300,7 @@ codePush.getCurrentPackage(function (update) {
300300
console.log("No updates have been installed");
301301
return;
302302
}
303-
303+
304304
// If the current app "session" represents the first time
305305
// this update has run, and it had a description provided
306306
// 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
321321
When the update retrieval completes, it will trigger the `onSuccess` callback with one of two possible values:
322322
323323
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+
325325
2. A `LocalPackage` instance which represents the metadata for the currently pending CodePush update.
326326
327327
Parameters:
@@ -387,7 +387,7 @@ Example Usage:
387387
388388
```javascript
389389
// Fully silent update which keeps the app in
390-
// sync with the server, without ever
390+
// sync with the server, without ever
391391
// interrupting the end user
392392
codePush.sync();
393393

@@ -408,7 +408,7 @@ While the sync method tries to make it easy to perform silent and active updates
408408
- __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:
409409
410410
- __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+
412412
- __receivedBytes__ *(Number)* - The number of bytes downloaded thus far, which can be used to track download progress.
413413
414414
#### SyncOptions
@@ -466,14 +466,14 @@ codePush.sync(null, { updateDialog: { updateTitle: "An update is available!" } }
466466
codePush.sync(null, {
467467
updateDialog: {
468468
appendReleaseDescription: true,
469-
descriptionPrefix: "\n\nChange log:\n"
469+
descriptionPrefix: "\n\nChange log:\n"
470470
},
471471
installMode: InstallMode.IMMEDIATE
472472
});
473473

474474
// Silently check for the update, but
475475
// display a custom downloading UI
476-
// via the SyncStatus and DowloadProgress callbacks
476+
// via the SyncStatus and DownloadProgress callbacks
477477
codePush.sync(syncStatus, null, downloadProgress);
478478

479479
function syncStatus(status) {
@@ -499,7 +499,7 @@ The `sync` method can be called anywhere you'd like to check for an update. That
499499
500500
### Package objects
501501
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:
503503
504504
1. `LocalPackage`: Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
505505
@@ -561,7 +561,7 @@ var onUpdateCheck = function (remotePackage) {
561561
if (!remotePackage) {
562562
console.log("The application is up to date.");
563563
} 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.
565565
// This way, we avoid going into an infinite bad update/revert loop.
566566
if (!remotePackage.failedInstall) {
567567
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
667667
- __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`.
668668
669669
- __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.
672672
673673
- __IN_PROGRESS__: Another sync is already running, so this attempt to sync has been aborted.
674674

bin/www/localPackage.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var LocalPackage = (function (_super) {
8686
});
8787
}
8888
catch (e) {
89-
installError && installError(new Error("An error occured while installing the package. " + CodePushUtil.getErrorMessage(e)));
89+
installError && installError(new Error("An error occurred while installing the package. " + CodePushUtil.getErrorMessage(e)));
9090
}
9191
};
9292
LocalPackage.prototype.verifyPackage = function (deploymentResult, installError, successCallback) {
@@ -232,20 +232,26 @@ var LocalPackage = (function (_super) {
232232
var installModeToUse = _this.isMandatory ? installOptions.mandatoryInstallMode : installOptions.installMode;
233233
if (installModeToUse === InstallMode.IMMEDIATE) {
234234
installSuccess && installSuccess(installModeToUse);
235-
cordova.exec(function () { }, function () { }, "CodePush", "install", [deployDir.fullPath,
236-
installModeToUse.toString(), installOptions.minimumBackgroundDuration.toString()]);
235+
cordova.exec(function () { }, function () { }, "CodePush", "install", [
236+
deployDir.fullPath,
237+
installModeToUse.toString(),
238+
installOptions.minimumBackgroundDuration.toString()
239+
]);
237240
}
238241
else {
239-
cordova.exec(function () { installSuccess && installSuccess(installModeToUse); }, function () { installError && installError(); }, "CodePush", "install", [deployDir.fullPath,
240-
installModeToUse.toString(), installOptions.minimumBackgroundDuration.toString()]);
242+
cordova.exec(function () { installSuccess && installSuccess(installModeToUse); }, function () { installError && installError(); }, "CodePush", "install", [
243+
deployDir.fullPath,
244+
installModeToUse.toString(),
245+
installOptions.minimumBackgroundDuration.toString()
246+
]);
241247
}
242248
};
243249
var preInstallSuccess = function () {
244250
invokeSuccessAndInstall();
245251
};
246252
var preInstallFailure = function (preInstallError) {
247253
CodePushUtil.logError("Preinstall failure.", preInstallError);
248-
var error = new Error("An error has occured while installing the package. " + CodePushUtil.getErrorMessage(preInstallError));
254+
var error = new Error("An error has occurred while installing the package. " + CodePushUtil.getErrorMessage(preInstallError));
249255
installError && installError(error);
250256
};
251257
cordova.exec(preInstallSuccess, preInstallFailure, "CodePush", "preInstall", [deployDir.fullPath]);

0 commit comments

Comments
 (0)