Skip to content

Commit 9cc51be

Browse files
committed
remove: remove fallbackToAppCenter option
1 parent 5b83c97 commit 9cc51be

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

CodePush.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,8 @@ async function checkForUpdate(deploymentKey = null, handleBinaryVersionMismatchC
146146
};
147147
} catch (error) {
148148
log(`An error has occurred at update checker : ${error.stack}`);
149-
if (sharedCodePushOptions.fallbackToAppCenter) {
150-
return await sdk.queryUpdateWithCurrentPackage(queryPackage);
151-
} else {
152-
// update will not happen
153-
return undefined;
154-
}
149+
// update will not happen
150+
return undefined;
155151
}
156152
})()
157153
: await sdk.queryUpdateWithCurrentPackage(queryPackage);
@@ -639,8 +635,6 @@ let CodePush;
639635
* setRuntimeVersion(version: string): void,
640636
* versioning: Versioning
641637
* setVersioning(versioning: Versioning): void
642-
* fallbackToAppCenter: boolean,
643-
* setFallbackToAppCenter(enable: boolean): void
644638
* }}
645639
*/
646640
const sharedCodePushOptions = {
@@ -668,10 +662,6 @@ const sharedCodePushOptions = {
668662
setUpdateChecker(updateCheckerFunction) {
669663
if (updateCheckerFunction && typeof updateCheckerFunction !== 'function') throw new Error('pass a function to setUpdateChecker');
670664
this.updateChecker = updateCheckerFunction;
671-
},
672-
fallbackToAppCenter: true,
673-
setFallbackToAppCenter(enable) {
674-
this.fallbackToAppCenter = enable;
675665
}
676666
}
677667

@@ -699,7 +689,6 @@ function codePushify(options = {}) {
699689
sharedCodePushOptions.setBundleHost(options.bundleHost);
700690
sharedCodePushOptions.setRuntimeVersion(options.runtimeVersion);
701691
sharedCodePushOptions.setUpdateChecker(options.updateChecker);
702-
sharedCodePushOptions.setFallbackToAppCenter(options.fallbackToAppCenter);
703692

704693
const decorator = (RootComponent) => {
705694
class CodePushComponent extends React.Component {

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Specify a function to perform the update check using the `updateChecker` option.
2929

3030
(The `bundleHost` option can be used in combination.)
3131

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)
3332

3433
```javascript
3534
const codePushOptions = {
@@ -41,7 +40,6 @@ const codePushOptions = {
4140
});
4241
return response;
4342
},
44-
fallbackToAppCenter: true,
4543
};
4644

4745
export default codePush(codePushOptions)(MyApp);

typings/react-native-code-push.d.ts

-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ export interface CodePushOptions extends CodePushSharedOptions, SyncOptions {
9292
* Defaults to codePush.CheckFrequency.ON_APP_START.
9393
*/
9494
checkFrequency: CodePush.CheckFrequency;
95-
/**
96-
* Specifies whether to run the original action, which queries AppCenter if an error occurs while running the `updateChecker` function.
97-
*/
98-
fallbackToAppCenter?: boolean;
9995
/**
10096
* Specifies a function to get the release history.
10197
*/

0 commit comments

Comments
 (0)