How can i get the versionCode to use with update function?


I saw the ngCordova plugin ,But it only return versionName.
Is anyway to return versionCode that is simple to compare?
If not ,the only way to compare version to check update is compare versionName by char?


Well the version in your config.xml should be something like version="0.9.2", so cordova.getAppVersion will return “0.9.2”. This is not really a version name, it’s a string but you can easily compare it with another appVersion to see whats the newer version.

Or is your problem that you have a name for the version in your config.xml? In that case you can only compare it by chars. The ngCordova wrapper just returns exactly that string. Do you think it should return another version code anywhere specified?


I dev on android,so android apk always privoid versionCode.


Pulled up a new question here which is related to this.

Cant solve it help is needed.