sampart / cordova-plugin-app-version

Cordova plugin to return the version number of the current app [not maintained]
MIT License
401 stars 195 forks source link

getVersionNumber returns undefined #104

Closed veronesecoms closed 6 years ago

veronesecoms commented 6 years ago

I need to check the version of the application to do validations, the problem is that the promisse getVersionNumber () is returning me undefined.

I tried something like:

$ ionic cordova plugin add cordova-plugin-app-version $ npm install --save @ionic-native/app-version

ngOnInit (): void {
     let versionApp;
     this.appVersion.getVersionNumber (). then (version => {
       versionApp = version;
     });

this.dialogs.alert (versionApp);

However within the alert it is returned undefined. In my config.xml, the version is populated as follows:

<widget id = "idapp" version = "0.0.4" xmlns = "http://www.w3.org/ns/widgets" xmlns: cdv = "http://cordova.apache.org/ns/1.0" >

veronesecoms commented 6 years ago

sorry, my code is wrong.

that's work when the dialogs is inside the .then