App version in Ionic2

Hey guys,
What’s the best way to get the application version within the application to show on a about page? As far I see it’s already manually entered into config.xml… if I put it in two places I will never keep them in sync.

I have been look at cordova-plugin-app-version, should I use this or is there a better way in ionic2?

I use the plugin and it works fine for me.

1 Like

hey i tried to fetch app version but i didn’t know why its not set in my variable.

AppVersion.getVersionNumber().then((s) => {
this.fetchData = s;
in above code ‘s’ value print proper. and when i print this.fetchData …print undefined. i tired code in android device… i already install plugin.

For me works:

   AppVersion.getVersionNumber().then( (version)=> {
      this.version = version;

Where and how are you trying to print this.fetchData?

It seems to me that you’re having trouble with the scope of this.

hi did you find the solution ?im facing the same problem