microsoft / cordova-plugin-code-push

Cordova plugin for CodePush
http://appcenter.ms
Other
643 stars 333 forks source link

App freezes on the 2nd startup after code push works. #553

Open CharlieAndLouise opened 5 years ago

CharlieAndLouise commented 5 years ago

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:

  1. Start app by XCode.
  2. App is updated and restarted as expected.
  3. Shut down the app by Home + swipe up
  4. reopen app or start app by XCode
  5. freeze on splashing screen. (Issue)
  6. Cannot see "start" or "end" in console (Safari)
  7. Manually run codePush.restartApplication() then app can run properly.
gabriele-sacchi commented 5 years ago

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.