-api-id | -api-type |
---|---|
T:Windows.ApplicationModel.Store.ProductLicense |
winrt class |
Provides info about a license that is associated with an add-on (also called an in-app product or IAP).
The ProductLicenses property of the LicenseInformation object contains one or more instances of this object.
The following code example demonstrates how to use this object to get the expiration date of an add-on offer.
// 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;
Store sample, Trial app and in-app purchase sample, Enable in-app product purchases