unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.06k stars 736 forks source link

`Package.Current.Id` Not providing right `Build/Revision` number for mobile #11216

Open Soap-141 opened 1 year ago

Soap-141 commented 1 year ago

Current behavior

The current Uno implementation only make use of versionName for Android and CFBundleShortVersionString for iOS when it should also use versionCode for Android and CFBundleVersion for iOS as Build/Revision value. See Uno documentation for more details.

So currently we must use a version with 4 numbers if we want to have the Build/Revision information in our application but on iOS they must absolutely be separated because the version as to be composed of 3 numbers. See Apple documentation for more details.

The implementation should resemble Xamarin/MAUI Essentials a bit more for application version reading. See MAUI repositery for more details.

Expected behavior

Revision value should use versionCode for Android and CFBundleVersion for iOS or we should have an extension for the build if it's more than one digit. Whatever is best to make use of every mobile version variable.

How to reproduce it (as minimally and precisely as possible)

No sample needed, it's working but limiting our application.

Workaround

Use Xamarin/MAUI Essentials.

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

No response

Affected platforms

Android, iOS, Windows

IDE

Visual Studio 2022

IDE version

17.4.4

Relevant plugins

No response

Anything else we need to know?

No response

fperreaultnv commented 1 year ago

I think you mean : Windows.ApplicationModel.Package.Current.Id