# Help App Version

**URL:** <https://forum.ionicframework.com/t/help-app-version/53843>\
**Category:** ionic-v3\
**Created:** [June 3, 2016, 6:16pm UTC](https://forum.ionicframework.com/t/help-app-version/53843 "2016-06-03T18:16:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilton\_felicio](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nilton_felicio/32/100637_2.png) [@nilton\_felicio](https://forum.ionicframework.com/u/nilton_felicio)\
**Post date:** [June 3, 2016, 6:16pm UTC](https://forum.ionicframework.com/t/help-app-version/53843/1 "2016-06-03T18:16:43Z")

</div>

I’m no expert.  
Sorry if the question is insignificant, but as I’m learning to ask.

How to use native ionic 2, in the following situation:  
How to print in html(AppVersion.getVersionCode();)?  
What is the process to get the result? Will the constructor? Could you give me a simple example of use? The way that the documentation I could not understand.

in .js  
import {AppVersion} from ‘ionic-native’;

AppVersion.getAppName();  
AppVersion.getPackageName();  
AppVersion.getVersionCode();  
AppVersion.getVersionNumber();

in .html  
`<ion-card-content> {{VERSAO}} </ion-card-content>`

I have already installed the plugin in my project.  
$ ionic plugin add cordova-plugin-app-version

---

<div class="post-metadata">

**Author:** ![fuffenz](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@fuffenz](https://forum.ionicframework.com/u/fuffenz)\
**Post date:** [June 5, 2016, 7:26pm UTC](https://forum.ionicframework.com/t/help-app-version/53843/2 "2016-06-05T19:26:22Z")

</div>

I think all those functions return a promise rather than a value. Try something like this in your constructor:

```
this.versionNumber = 'unknown';

if(this.platform.is('cordova')) {
    AppVersion.getVersionNumber().then((s) => {
    this.versionNumber = s;
  })
} 

```

and then use

```
{{versionNumber}}

```

in your html template.

The “[platform.is](http://platform.is)” wrapper is to avoid errors if you’re testing in a browser.

---

<div class="post-metadata">

**Author:** ![nilton\_felicio](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nilton_felicio/32/100637_2.png) [@nilton\_felicio](https://forum.ionicframework.com/u/nilton_felicio)\
**Post date:** [June 5, 2016, 7:41pm UTC](https://forum.ionicframework.com/t/help-app-version/53843/3 "2016-06-05T19:41:27Z")

</div>

Thank you fuffenz, I will test .  
I think the documentation lack a better example. Especially for those who are learning .

---

<div class="post-metadata">

**Author:** ![varshil29](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@varshil29](https://forum.ionicframework.com/u/varshil29)\
**Post date:** [August 31, 2016, 1:54pm UTC](https://forum.ionicframework.com/t/help-app-version/53843/4 "2016-08-31T13:54:15Z")

</div>

hey i tried above code but i getting problem …in my case version get but when i assign version to variable didn’t work

AppVersion.getVersionNumber().then((s) =\> {  
console.log(‘ver’,s);  
this.fetchData = s;  
});

in above code ‘s’ value print proepr but when i print this.fetchData…print undefined

---

<div class="post-metadata">

**Author:** ![neogucky](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/neogucky/32/122043_2.png) [@neogucky](https://forum.ionicframework.com/u/neogucky)\
**Post date:** [November 16, 2018, 9:02am UTC](https://forum.ionicframework.com/t/help-app-version/53843/5 "2018-11-16T09:02:26Z")

</div>

Might be a scope problem, are you sure “this” is referring to the correct namespace?

---

<div class="post-metadata">

**Author:** ![JamesPeck](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JamesPeck](https://forum.ionicframework.com/u/JamesPeck)\
**Post date:** [November 16, 2018, 8:26pm UTC](https://forum.ionicframework.com/t/help-app-version/53843/6 "2018-11-16T20:26:49Z")

</div>

this thread is 2 years old

---

<div class="post-metadata">

**Author:** ![neogucky](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/neogucky/32/122043_2.png) [@neogucky](https://forum.ionicframework.com/u/neogucky)\
**Post date:** [November 16, 2018, 8:43pm UTC](https://forum.ionicframework.com/t/help-app-version/53843/7 "2018-11-16T20:43:06Z")

</div>

My bad, I only saw „3 month“ on top of the comment and misstook it for the age.
