StoreAppLicense StoreAppLicense StoreAppLicense StoreAppLicense StoreAppLicense Class

Definition

Provides license info for the current app, including licenses for products that are offered by the app.

public : sealed class StoreAppLicense : IStoreAppLicense
struct winrt::Windows::Services::Store::StoreAppLicense : IStoreAppLicense
public sealed class StoreAppLicense : IStoreAppLicense
Public NotInheritable Class StoreAppLicense Implements IStoreAppLicense
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Services.Store.StoreContract (introduced v1)

Remarks

The StoreContext.GetAppLicenseAsync method returns an object of this type.

Properties

AddOnLicenses AddOnLicenses AddOnLicenses AddOnLicenses AddOnLicenses

Gets the collection of licenses for durable add-ons for which the user has entitlements to use. This property does not include licenses for consumable add-ons.

public : IMapView<Platform::String, StoreLicense> AddOnLicenses { get; }
IMapView<winrt::hstring, StoreLicense> AddOnLicenses();
public IReadOnlyDictionary<string, StoreLicense> AddOnLicenses { get; }
Public ReadOnly Property AddOnLicenses As IReadOnlyDictionary<string, StoreLicense>
var iReadOnlyDictionary = storeAppLicense.addOnLicenses;
Value
IReadOnlyDictionary<string, StoreLicense> IReadOnlyDictionary<string, StoreLicense> IReadOnlyDictionary<string, StoreLicense>

A map of key and value pairs, where each key is the Store ID of an add-on SKU from the Microsoft Store catalog and each value is a StoreLicense object that contains license info for the add-on.

Remarks

This collection contains durable add-on licenses that are currently valid. When a license is expired or no longer valid, it will no longer be available in this collection.

ExpirationDate ExpirationDate ExpirationDate ExpirationDate ExpirationDate

Gets the expiration date and time for the app license.

public : DateTime ExpirationDate { get; }
DateTime ExpirationDate();
public DateTimeOffset ExpirationDate { get; }
Public ReadOnly Property ExpirationDate As DateTimeOffset
var dateTimeOffset = storeAppLicense.expirationDate;
Value
DateTimeOffset DateTimeOffset DateTimeOffset

The expiration date and time for the app license, relative to the system clock.

ExtendedJsonData ExtendedJsonData ExtendedJsonData ExtendedJsonData ExtendedJsonData

Gets complete license data in JSON format.

public : Platform::String ExtendedJsonData { get; }
winrt::hstring ExtendedJsonData();
public string ExtendedJsonData { get; }
Public ReadOnly Property ExtendedJsonData As string
var string = storeAppLicense.extendedJsonData;
Value
string string string

A JSON-formatted string that contains the complete license data.

Remarks

Use the ExtendedJsonData property to access the complete data for the StoreAppLicense object as a JSON-formatted string in your code. For more information about the structure of the data, see Data schemas for Store products.

See Also

IsActive IsActive IsActive IsActive IsActive

Gets a value that indicates whether the license is valid and provides the current user an entitlement to use the app.

public : Platform::Boolean IsActive { get; }
bool IsActive();
public bool IsActive { get; }
Public ReadOnly Property IsActive As bool
var bool = storeAppLicense.isActive;
Value
bool bool bool

True if the license is valid and provides the current user an entitlement to use the app; otherwise, false.

IsTrial IsTrial IsTrial IsTrial IsTrial

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

public : Platform::Boolean IsTrial { get; }
bool IsTrial();
public bool IsTrial { get; }
Public ReadOnly Property IsTrial As bool
var bool = storeAppLicense.isTrial;
Value
bool bool bool

True if the license is a trial license; otherwise, false.

IsTrialOwnedByThisUser IsTrialOwnedByThisUser IsTrialOwnedByThisUser IsTrialOwnedByThisUser IsTrialOwnedByThisUser

Gets a value that indicates whether the current user has an entitlement for the usage-limited trial that is associated with this app license.

public : Platform::Boolean IsTrialOwnedByThisUser { get; }
bool IsTrialOwnedByThisUser();
public bool IsTrialOwnedByThisUser { get; }
Public ReadOnly Property IsTrialOwnedByThisUser As bool
var bool = storeAppLicense.isTrialOwnedByThisUser;
Value
bool bool bool

True if the current user has an entitlement for the trial; otherwise, false.

Remarks

This property is intended to be used by developers who have configured their app as a usage-limited trial in the Windows Dev Center dashboard. Usage-limited trials are not available to all developer accounts.

SkuStoreId SkuStoreId SkuStoreId SkuStoreId SkuStoreId

Gets the Store ID of the licensed app SKU from the Microsoft Store catalog.

public : Platform::String SkuStoreId { get; }
winrt::hstring SkuStoreId();
public string SkuStoreId { get; }
Public ReadOnly Property SkuStoreId As string
var string = storeAppLicense.skuStoreId;
Value
string string string

The Store ID of a the licensed app SKU from the Microsoft Store catalog.

TrialTimeRemaining TrialTimeRemaining TrialTimeRemaining TrialTimeRemaining TrialTimeRemaining

Gets the remaining time for the usage-limited trial that is associated with this app license.

public : TimeSpan TrialTimeRemaining { get; }
TimeSpan TrialTimeRemaining();
public TimeSpan TrialTimeRemaining { get; }
Public ReadOnly Property TrialTimeRemaining As TimeSpan
var timeSpan = storeAppLicense.trialTimeRemaining;
Value
TimeSpan TimeSpan TimeSpan

The remaining time for the usage-limited trial that is associated with this app license.

Remarks

This property is intended to be used by developers who have configured their app as a usage-limited trial in the Windows Dev Center dashboard. Usage-limited trials are not available to all developer accounts.

TrialUniqueId TrialUniqueId TrialUniqueId TrialUniqueId TrialUniqueId

Gets a unique ID that identifies the combination of the current user and the usage-limited trial that is associated with this app license.

public : Platform::String TrialUniqueId { get; }
winrt::hstring TrialUniqueId();
public string TrialUniqueId { get; }
Public ReadOnly Property TrialUniqueId As string
var string = storeAppLicense.trialUniqueId;
Value
string string string

A unique ID that identifies the combination of the current user and the usage-limited trial that is associated with this app license.

Remarks

This property is intended to be used by developers who have configured their app as a usage-limited trial in the Windows Dev Center dashboard. Usage-limited trials are not available to all developer accounts.