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.LongVersionCodeand if that fails (this is alongvalue while UWP 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 UWP 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 ofCFBundleVersionsimilarly to UWP where it contains the app version.