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

Commit 292359a

Browse files
committed
Renaming restartPendingUpdate
1 parent 7f21bae commit 292359a

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

CodePush.ios.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var packageMixins = require("./package-mixins")(NativeCodePush);
66
var requestFetchAdapter = require("./request-fetch-adapter.js");
77
var Sdk = require("code-push/script/acquisition-sdk").AcquisitionManager;
88

9-
function checkForUpdate(deploymentKey) {
9+
function checkForUpdate(deploymentKey = null) {
1010
var config;
1111
var sdk;
1212

@@ -274,12 +274,15 @@ function sync(options = {}, syncStatusChangeCallback, downloadProgressCallback)
274274
});
275275
};
276276

277+
codePush.installPendingUpdate();
278+
277279
var CodePush = {
278280
checkForUpdate: checkForUpdate,
279281
getConfiguration: getConfiguration,
280282
getCurrentPackage: getCurrentPackage,
281283
log: log,
282284
notifyApplicationReady: NativeCodePush.notifyApplicationReady,
285+
restartPendingUpdate: NativeCodePush.restartPendingUpdate,
283286
setUpTestDependencies: setUpTestDependencies,
284287
sync: sync,
285288
InstallMode: {

CodePush.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ - (void)startRollbackTimer:(int)rollbackTimeout
346346
resolve([NSNull null]);
347347
}
348348

349-
// This version of restart app is exposed solely for immediately installed
349+
// This function is exposed solely for immediately installed
350350
// update support, and shouldn't be consumed directly by user code.
351-
RCT_EXPORT_METHOD(restartForImmedidateUpdate:(int)rollbackTimeout)
351+
RCT_EXPORT_METHOD(restartImmedidateUpdate:(int)rollbackTimeout)
352352
{
353353
[self initializeUpdateWithRollbackTimeout:rollbackTimeout needsRestart:YES];
354354
}
355355

356-
RCT_EXPORT_METHOD(restartForPendingUpdate)
356+
RCT_EXPORT_METHOD(restartPendingUpdate)
357357
{
358358
[self checkForPendingUpdate:YES];
359359
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ When you require the `react-native-code-push` module, that object provides the f
124124
125125
* [checkForUpdate](#codepushcheckforupdate): Queries the CodePush service for an update against the configured deployment. This method returns a promise which resolves to a `RemotePackage` that can be subsequently downloaded.
126126
* [getCurrentPackage](#codepushgetcurrentpackage): Gets information about the currently installed package (e.g. description, installation time)
127-
* [notifyApplicationReady](#codepushnotifyapplicationready): Notifies the CodePush runtime that an installed update is considered successful. This is an optional API, but is useful when you want to expicitly enable "rollback protection" in the event that an exception occurs in any code that you've deployed to production
127+
* [notifyApplicationReady](#codepushnotifyapplicationready): Notifies the CodePush runtime that an installed update is considered successful. This is an optional API, but is useful when you want to expicitly enable "rollback protection" in the event that an exception occurs in any code that you've deployed to production.
128128
* [sync](#codepushsync): Allows checking for an update, downloading it and installing it, all with a single call. Unless you need custom UI and/or behavior, we recommend most developers to use this method when integrating CodePush into their apps
129129
130130
#### codePush.checkForUpdate
131131
132132
```javascript
133-
codePush.checkForUpdate(deploymentKey: String): Promise<RemotePackage>;
133+
codePush.checkForUpdate(deploymentKey: String = null): Promise<RemotePackage>;
134134
```
135135

136-
Queries the CodePush service for an update from the deployment configured in your `Info.plist` file, or specified using the optional `deploymentKey` parameter. This method returns a promise which resolves to a `RemotePackage` that can be subsequently downloaded.
136+
Queries the CodePush service for an update using the deployment configured either in your `Info.plist` file or specified using the optional `deploymentKey` parameter. This method returns a promise which resolves to a `RemotePackage` that can be subsequently downloaded.
137137

138138
`checkForUpdate` returns a Promise that resolves to one of two values:
139139

package-mixins.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ module.exports = (NativeCodePush) => {
4040
.then(function() {
4141
updateInstalledCallback && updateInstalledCallback();
4242
if (installMode == NativeCodePush.codePushInstallModeImmediate) {
43-
NativeCodePush.restartForImmedidateUpdate(rollbackTimeout);
44-
} else {
45-
this.restart = function () {
46-
NaviteCodePush.restartForPendingUpdate();
47-
}
48-
}
43+
NativeCodePush.restartImmedidateUpdate(rollbackTimeout);
44+
};
4945
});
5046
}
5147
};

0 commit comments

Comments
 (0)