LicenseInformation Class

Definition

Provides access to the current app's license metadata.

public ref class LicenseInformation sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class LicenseInformation final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class LicenseInformation
Public NotInheritable Class LicenseInformation
Inheritance
Object Platform::Object IInspectable LicenseInformation
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

For app trial versions of an app, IsActive will return true so long as the trial hasn’t expired. During the trial period the IsTrial returns true; returning false when the customer upgrades to the full version of the app.

You access this object through the LicenseInformation property of the CurrentAppSimulator object during testing, or the LicenseInformation property of the CurrentApp object when the app is distributed through the Microsoft Store.

Note

The CurrentApp object obtains its data from the Microsoft Store, which requires that you have a Microsoft Store developer account and that the app has been published in the Microsoft Store. If you don't have a Microsoft Store developer account, you can test the functions of this class by using the CurrentAppSimulator.

Properties

ExpirationDate

Gets the license expiration date and time relative to the system clock.

IsActive

Gets a value that indicates whether the license is active.

IsTrial

Gets a value that indicates whether the license is a trial license.

ProductLicenses

Gets the associative list of licenses for in-app products that the user is currently entitled to.

Events

LicenseChanged

Raises a notification event when the status of the app's license changes.

Applies to

See also