# Not able to use AppVersion plugin

**URL:** <https://forum.ionicframework.com/t/not-able-to-use-appversion-plugin/74407>\
**Category:** ionic-v3\
**Created:** [December 26, 2016, 4:28pm UTC](https://forum.ionicframework.com/t/not-able-to-use-appversion-plugin/74407 "2016-12-26T16:28:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![riteshbhat17](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@riteshbhat17](https://forum.ionicframework.com/u/riteshbhat17)\
**Post date:** [December 26, 2016, 4:28pm UTC](https://forum.ionicframework.com/t/not-able-to-use-appversion-plugin/74407/1 "2016-12-26T16:28:20Z")

</div>

I tried using AppVersion plugin to get the version of app…but in console.log it shows the returned value as undefined…

```
this.platform.ready().then(() => {
            
            if (this.platform.is('cordova') ) {
                AppVersion.getVersionNumber().then( (version)=> {
                    this.appVersion = version;
                });
            }
        });
        console.log("APP VERSION :::", this.appVersion); //this gives back return

```

Any idea what is wring here?

---

<div class="post-metadata">

**Author:** ![chrisbenseler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/chrisbenseler/32/90788_2.png) [@chrisbenseler](https://forum.ionicframework.com/u/chrisbenseler)\
**Post date:** [December 26, 2016, 5:31pm UTC](https://forum.ionicframework.com/t/not-able-to-use-appversion-plugin/74407/2 "2016-12-26T17:31:30Z")

</div>

Your console.log is outside the function passed to the _then_ from the Pomise.  
It runs before the promise is resolved. Put it inside it, will work:

```
AppVersion.getVersionNumber().then( (version)=> {
	this.appVersion = version;
	console.log('App version is', version)
});
```
