How to output my versionCode from Cordova?

Without any Cordova plugins please, e.g. https://github.com/whiteoctober/cordova-plugin-app-version

There are various versions of my Android app in the wild and I’d like to output the Cordova client’s version code when reporting an exception to my server.

Is it just something glaringly obvious & simple? Thanks in advance!

Do you mean the hash that is assigned to the cordova build?

I think is this one:
__meteor_runtime_config__.autoupdateVersionCordova

https://github.com/meteor/meteor/blob/be986fd70926c9dd8eff6d8866205f236c8562c4/packages/webapp-hashing/webapp-hashing.js Is hashed using plugin
versions

Hi!

I mean the one in AndroidManifest.xml, referenced here: http://stackoverflow.com/questions/32179872/meteor-js-android-version-code

Bump… should be a quick & simple one? :relaxed:

I don’t think that is actually exposed :confused:

Looking through the code: https://github.com/meteor/meteor/blob/fa21921280b8741c6bf5057614ca3873654cd158/tools/cordova/builder.js#L233
the version is passed to an XmlBuilder and then written as the Cordova’s config.xml.

So the version isn’t stored in any other place.

You can use this cordova plugin to expose the version: https://github.com/whiteoctober/cordova-plugin-app-version

1 Like

Thanks for looking! If only I had known to include that plugin before I let the app loose in the wild…

1 Like