Check Ionic App new version

I am looking for a way to show the user an Ionic popup if there is a new version of an Ionic app.

I will use inside app.js .run section and trigger an ionic poup if there is a new version .

What i am confuse about, is how can i read a file that indicate a new version, can config.xml file provide this information ? into version atribute or id atribute of the widget xml markup ?

//Verify new version and trigger a warning
  .success( function(data) {
      console.log(' success data '+data);
      actualAppversion = somewhere(); //TODO: define a service that retrieve the actual version
      $scope.appVersionActual = actualAppversion;
      $scope.appNewVersion  = data;
      if($scope.appNewVersion!= $scope.appVersionActual){
        $ionicPopup.confirm({title: "You have an old version",content: "A new version is available."})
  console.log('Had an error'+error);


You can try with this plugin, I’ve never used this before, but it seems to fit your goal.

Also available on ngCordova:

1 Like

Trying to figure out why i did not get the version

I do install the plugin, and follow post

Window.cordova is always undefined and did not get the version.

I declare a variable outside the module :

var appVersion = "0.0.0";

    .run(function($ionicPlatform, $ionicPopup) {
      $ionicPlatform.ready(function() {
        if (window.cordova && window.cordova.plugins.Keyboard) {
  cordova.getAppVersion(function(version) {
            appVersion = version
            alert('appVersion : '+appVersion);
            console.log('appVersion : '+appVersion);
            $ionicPopup.confirm({title: "Version", content: "appVersion : "+appVersion })

Are you testing only in the browser ? Have you already tried it on the emulator/device ? There are certain plugins that will work in the browser, as said here

No i am testing on device with Android 4.1.2. Seems my problem is cordova being undefined, so cordova.getAppVersion will follow this undefined state.

Creating a blank app from scratch just work´s . Some javascript must be in conflict with cordova.js

1 Like