Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ProductLicense class

Provides info about a license that is associated with an in-app product.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The ProductLicense class has these types of members:

Properties

The ProductLicense class has these properties.

PropertyAccess typeDescription

ExpirationDate

Read-onlyGets the current expiration date and time of the in-app product license.

IsActive

Read-onlyIndicates if the in-app product license is currently active.

IsConsumable

Read-onlyIndicates if the in-app product is consumable. A consumable product is a product that can be purchased, used, and purchased again.

ProductId

Read-onlyGets the ID of an in-app product. 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.

 

Remarks

The ProductLicenses property of the LicenseInformation object is contains one or more instances of this object. The following code example demonstrates how to retrieve this object:


// 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 product 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 (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Store
Windows::ApplicationModel::Store [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

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

Windows.ApplicationModel.Store
Windows::ApplicationModel::Store [C++]

Metadata

Windows.winmd

See also

Object
Trial app and in-app purchase sample
How to enable in-app purchases from your app

 

 

Show:
© 2015 Microsoft