ProductLicense class
Provides info about a license that is associated with an in-app offer.
Syntax
/* For information about creating or accessing this object, see Remarks. */
Attributes
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The ProductLicense class has these types of members:
Methods
The ProductLicense class inherits methods from the Object class (C#/VB/C++).
Properties
The ProductLicense class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the expiration date and time of the license. | |
| Read-only | Gets the value that indicates whether the feature's license is active. | |
| Read-only | Windows Phone only. Gets whether this product is a consumable. A consumable product is a product that can be purchased, used, and purchased again. | |
| Read-only | Gets the ID of an app's in-app offer. |
Remarks
You access this object by picking an element of the collection that the ProductLicenses property of the LicenseInformation object returns as the following code example shows.
// get current app object using the simulator interface currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator; // get the license information object licenseInformation = currentApp.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");
Examples
Get the expiration date of an in-app offer.
// get current app object using the simulator interface currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator; // get the license information object licenseInformation = currentApp.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;
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
See also
- Trial app and in-app purchase sample
- In-app offer description checklist
- How to support in-app purchases
Build date: 2/25/2013
