Package Information
Tip
This article covers Uno-specific information for ApplicationModel. For a full description of the feature and instructions on using it, see Windows.ApplicationModel Namespace.
- The
Windows.ApplicationModel.PackageIdclass allows retrieving information about the application package.
PackageId
Android
- Due to the fact that version strings can be arbitrary on Android, we first try to parse
PackageInfo.VersionName, if it fails, we try to usePackageInfo.LongVersionCode, and if that fails (this is alongvalue while WinUI usesushort), we fall back to default to avoid exceptions (1.0.0.0). FamilyNameandNameproperties have the same value as thePublisherand cannot be retrieved programmatically.FullNameproperty ends with the value ofLongVersionCode, similar to WinUI, where it contains the app version.
iOS
- Version strings may potentially be arbitrary on iOS as well (such version string would fail validation only during App Store upload), so we first try to parse the user-facing
CFBundleShortVersionString, if it fails, we try to useCFBundleVersionand if that fails, we fall back to default to avoid exceptions (1.0.0.0). FamilyNameandNameproperties have the same value as thePublishercannot be retrieved programmatically.FullNameproperty ends with the value ofCFBundleVersion, similarly to WinUI, where it contains the app version.