Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
instance.install(codePush.InstallMode.IMMEDIATE).then(() => {
console.log("安装完成");
codePush.notifyAppReady();
codePush.allowRestart();
codePush.restartApp(true);
}).catch(reason => {
CheckCodePushUpdateUtil.error();
async function init() {
codePush.notifyAppReady();
buildTheme();
store = await configStore();
store.subscribe(handleSubscribe);
registerScreens(store, Provider);
setI18nConfig();
RNLocalize.addEventListener('change', () => {
setI18nConfig();
});
}
export function appWillMount() {
if (isProduction()) {
return codePush.notifyAppReady();
}
}
useEffect(() => {
CodePush.notifyAppReady();
CodePush.sync(
{
installMode: CodePush.InstallMode.ON_NEXT_RESTART,
updateDialog: {
title: 'An OTA update is available',
description: 'Would you like to install it?',
},
rollbackRetryOptions: {
delayInHours: 0.1,
maxRetryAttempts: 1,
},
},
codePushStatusDidChange,
downloadProgressCallback,
);