Checking updates automatic when i open app

i want to automatic check updates my app when they open the app. because my app needs to press button to update my app.so i want to automatic update when they open it. tnx in advance guys.

1 Like

[Hi, I think you want to listen to the on resume event from cordova. You can find the Cordova documentation over here:

https://cordova.apache.org/docs/en/5.1.1/cordova/events/events.resume.html

What mechanism are you using for updating your app?`Are we talking about “update = new apk” or “update = download new /www with Ionic Deploy or similar”?

I think I might have misread your post. What exactly do you mean by updating your app on opening of the app? You mean like checking for a new deploy, or hitting some endpoint when (re)opening the app?

im using deploy.but in deploy they need button to update.
how to deploy to update my app without button?

im using deploy.but in deploy they need button to update.
how to deploy to update my app without button??

Ah. Just check upon startup from your app, that makes the most sense. So if users open up your app, this function get called (unless you’ve removed it off course):

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

In there you could just hook your check for updates function.

I have used HockeyApp for updates and uploading build and it worked like charm.
In initializeApp() method, you have to hookup following configuration.

this.hockeyapp.start(null, “”, false, true);

2 Likes