ProductLicense ProductLicense ProductLicense ProductLicense ProductLicense Class

Definition

Provides info about a license that is associated with an add-on (also called an in-app product or IAP).

public : sealed class ProductLicense : IProductLicense, IProductLicenseWithFulfillment
struct winrt::Windows::ApplicationModel::Store::ProductLicense : IProductLicense, IProductLicenseWithFulfillment
public sealed class ProductLicense : IProductLicense, IProductLicenseWithFulfillment
Public NotInheritable Class ProductLicense Implements IProductLicense, IProductLicenseWithFulfillment
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following code example demonstrates how to use this object to get the expiration date of an add-on offer.

// get current app object using the simulator interface
currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator;

// get the license information object
licenseInformation = CurrentAppSimulator.licenseInformation;

// get info about the licenses of the app's in-app offers
inAppOfferLicenses = licenseInformation.productLicenses;

// get the license information for a specific in-app offer
myFavoriteInAppOffer = inAppOfferLicenses("MyFavoriteInAppOffer");

// and look up the offer's expiration date
myFavoriteInAppOffer.expirationDate;
// get the license info for this app from the simulator
LicenseInformation licenseInformation = CurrentAppSimulator.LicenseInformation;

// get the license info for one of the app's in-app offers
ProductLicense inAppOfferLicense =
    licenseInformation.ProductLicenses["MyFavoriteInAppOffer"];

// get the expiration date of this in-app offer
DateTimeOffset expirationDate = inAppOfferLicense.ExpirationDate;

Remarks

The ProductLicenses property of the LicenseInformation object contains one or more instances of this object.

Properties

ExpirationDate ExpirationDate ExpirationDate ExpirationDate ExpirationDate

Gets the current expiration date and time of the add-on (also called an in-app product or IAP) license.

IsActive IsActive IsActive IsActive IsActive

Indicates if the add-on (also called an in-app product or IAP) license is currently active.

IsConsumable IsConsumable IsConsumable IsConsumable IsConsumable

Indicates if the add-on (also called an in-app product or IAP) is consumable. A consumable add-on can be purchased, used, and purchased again.

ProductId ProductId ProductId ProductId ProductId

Gets the ID of an add-on (also called an in-app product or IAP). This ID is used by the app to get info about the product or feature that is enabled when the customer buys it through an in-app purchase.

See Also