cordova-plugin-code-push
cordova-plugin-code-push copied to clipboard
App freezes on the 2nd startup after code push works.
console.log("start"); codePush.checkForUpdate( (result)=>{ if (!result) { console.log("This app is the latest one."); runApp(); } else { console.log(result); codePush.sync( ()=> { console.log("ready"); }, { updateDialog: true, installMode: window["InstallMode"].IMMEDIATE } ); } }, (error)=>{ console.log("Codepush service is down!"); runApp(); } ); console.log("end");
function runApp() { enableProdMode(); platformBrowserDynamic().bootstrapModule(AppModule).then(()=>{ if (!!window["_paq"]) { window["_paq"].push(["enableJSErrorTracking"]); } }); }
Environment: iPhone simulator XCode Safari "code-push": "^2.0.6", "cordova-plugin-code-push": "^1.11.18"
Repeat the issue:
- Start app by XCode.
- App is updated and restarted as expected.
- Shut down the app by Home + swipe up
- reopen app or start app by XCode
- freeze on splashing screen. (Issue)
- Cannot see "start" or "end" in console (Safari)
- Manually run codePush.restartApplication() then app can run properly.
I am having a similar issue: https://github.com/microsoft/cordova-plugin-code-push/issues/558
In my case the app does not freeze but all the updates are lost.