Open Knordy opened 8 years ago
I would use this too.
I was just about to fork this repo and add the versionCode property to the returning string.
Then, I re-read the official Android versioning guidelines and realized that you should not be using the versionCode property in the GUI. (I bet that the majority of people using this plugin does).
The versionCode is an internal thing. I have now re-considered and stopped displaying the versionCode.
If one do needs the versionCode for any purpose, it's Android specific anyway and could easily be obtained from Application.Context.PackageManager.GetPackageInfo( Application.Context.PackageName, PackageInfoFlags.MetaData).VersionCode;
Just my 2c and YMMV.
I disagree about versionCode should not be used in UI. I want to show this number for internal testing purposes. This property exists and I highly believe it should be available through the plugin. I can decide weather to show it or not.
I like @Knordy idea to provide few properties.
We ended up creating our own Version code, also because it needed to do more than this plugin could.
@mtrinder you have an opinion on this? I think it would be useful to make the android version string match iOS version string.
Same here! Please add version code!
+1, make it optional so you can satisfy "both sides" as in Knordy's example
In iOS you are creating a string by combining the version# and the build# (String.Format("{0}.{1}", version, build)), but in Android you're only returning the build# (VersionName).
So iOS and Android are displaying different app version #'s when using CrossVersion.Current.Version.
Is it possible to add the version# to Android (VersionCode), and perhaps let use choose which format we like to use? For example: CrossVersion.Current.Version CrossVersion.Current.VersionAndBuild CrossVersion.Current.Build