ProductListing class
Provides localized info about an in-app offer in your app.
Syntax
/* For information about creating or accessing this object, see Remarks. */
Attributes
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The ProductListing class has these types of members:
Methods
The ProductListing class inherits methods from the Object class (C#/VB/C++).
Properties
The ProductListing class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Windows Phone only. Gets the description for the product. | |
| Read-only | Gets the app's purchase price with the appropriate formatting for the current market. | |
| Read-only | Windows Phone only. Gets the URI of the image associated with this product. | |
| Read-only | Windows Phone only. Gets the list of keywords associated with this product. These keywords are useful for filtering product lists by keyword, for example, when calling LoadListingInformationByKeywordsAsync. | |
| Read-only | Gets the descriptive name of the product or feature that can be shown to customers in the current market. | |
| Read-only | Gets the ID of an app's feature or product. | |
| Read-only | Windows Phone only. Gets the type of this product. The type can be either ProductType.Durable or ProductType.Consumable. | |
| Read-only | Windows Phone only. Gets the tag string that contains custom information about this product. |
Remarks
You access this object by picking an element of the collection that the ProductListings property of the ListingInformation object returns as this code example shows.
// get current app object using the simulator interface currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator; // get the listing information for the products this app supports currentApp.loadListingInformationAsync().then( function (listing) { // loadListingInformationAsync returns the ListingInformation object in listing. // get the product listing collection from the ProductListings property. thisAppsProducts = listing.productListings; // now get a specific product. thisProduct = thisAppsProducts.lookup("product1"); } );
Examples
The code example here shows how to get the ListingInformation from simulated app data and then get the ProductListing object for one of the features offered by the app.
// get current app object using the simulator interface currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator; // get the listing information for the products this app supports currentApp.loadListingInformationAsync().then( function (listing) { // loadListingInformationAsync returns the ListingInformation object in listing. // now get info about a specific product and write it to the screen. thisProduct = listing.productListings.lookup("product1"); id("purchasePrice").innerText = "You can buy " + thisProduct.name + " for: " + thisProduct.formattedPrice + "."; } );
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
Build date: 2/25/2013
