Get App Version


#1

Hi !

i’m trying to get the app version. I’m using https://github.com/whiteoctober/cordova-plugin-app-version.

I’m trying to get the app version with :

cordova.getAppVersion.getVersionNumber(function (version) { }

But on android, the version is always “1.0”. Is it because I’m testing on a debug apk ?

Thanks for your help !


#2

Hi @Finality,

Have you double checked the version name on Android config.xml ?
And, are you sure you are using ngCordova app version method ?
Your code should be :

$cordovaAppVersion.getVersionNumber().then(function (version) {
    var appVersion = version;
  });
}, false);

#3

Hi !

in my manifest I have :

android:versionName="1.1.3"

#4

After a lot of tests, I found that the bug occurs when I add this plugin https://github.com/transistorsoft/cordova-background-geolocation-lt (premium version for android)

All works fine on IOS but on android, the return version stills 1.0

How is it possible ?


#5

Have you tried following this?:

Best,


#6

@nicraboy

Yes I use this plugin. but the problem appears when I use the geolocation plugin. How is it possible ? :frowning: