Update reload flicker

I’m using this bit of code from the docs:

My issue is once I hit 100% downloaded my splash screen goes gets hidden, THEN the app reloads & I see a switch from the old to the new. Is there a callback I can listen for to hide my splashscreen AFTER the app reloads with the new update?

// Check for updates
$ionicDeploy.check().then(function(response) {
  // response will be true/false
  if (response) {
    // Download the updates
    $ionicDeploy.download().then(function() {
      // Extract the updates
      $ionicDeploy.extract().then(function() {
        // Load the updated version
        $ionicDeploy.load();
      }, function(error) {
        // Error extracting
      }, function(progress) {
        // Do something with the zip extraction progress
        console.log(progress);
      });
    }, function(error) {
      // Error downloading the updates
    }, function(progress) {
      // Do something with the download progress
      if(progress>=100){
            $cordovaSplashscreen.hide()
          }
      console.log(progress);
    });
  }
}, function(error) {
  // Error checking for updates
});

Where do you show your splashscreen?

Is there a callback I can listen for to hide my splashscreen AFTER the app reloads with the new update?

Not really, as the code executing the “redirect” to the new version (that’s what the function is called internally) is not really there any more. The last thing that happens is (example from Java, Android) webView.loadUrlIntoView(deploy_url, recreatePlugins); - so the old app is replaced by the new one.

But you could probably check in your .run of app.js if there is a splashscreen (maybe somehow identify it as the “update” splash) and then hide it, not when the update progress hits 100%. Shouldn’t be too hard…

-J