ProductListing ProductListing ProductListing ProductListing ProductListing Class

Definition

Provides localized information that details an add-on (also called an in-app product or IAP).

public : sealed class ProductListing : IProductListing, IProductListing2, IProductListingWithMetadata
struct winrt::Windows::ApplicationModel::Store::ProductListing : IProductListing, IProductListing2, IProductListingWithMetadata
public sealed class ProductListing : IProductListing, IProductListing2, IProductListingWithMetadata
Public NotInheritable Class ProductListing Implements IProductListing, IProductListing2, IProductListingWithMetadata
// 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

This code example here shows how to get the ListingInformation from simulated app data and then get the ProductListing object an add-on.

// 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 + ".";
    }
);
// get the license info for this app from the simulator
ListingInformation listing = await CurrentAppSimulator.LoadListingInformationAsync();

// get the ProductListing object for the product named "product1"
ProductListing thisProduct = listing.ProductListings["product1"];

// format the purchase string or this in-app offer
String purchasePrice = "You can buy " + thisProduct.Name + 
    " for: " + thisProduct.FormattedPrice + ".";

Remarks

You access this object by picking an element of the collection that the ProductListings property of the ListingInformation object returns.

Properties

CurrencyCode CurrencyCode CurrencyCode CurrencyCode CurrencyCode

Gets the currency code associated with the user's market, such as USD or CAD.

Description Description Description Description Description

Gets the description for the add-on (also called an in-app product or IAP).

FormattedBasePrice FormattedBasePrice FormattedBasePrice FormattedBasePrice FormattedBasePrice

Gets the base price for the add-on (also called an in-app product or IAP) with the appropriate formatting for the current market.

FormattedPrice FormattedPrice FormattedPrice FormattedPrice FormattedPrice

Gets the purchase price for the in-app product with the appropriate formatting for the current market.

ImageUri ImageUri ImageUri ImageUri ImageUri

Gets the URI of the image associated with the add-on (also called an in-app product or IAP).

IsOnSale IsOnSale IsOnSale IsOnSale IsOnSale

Gets a value that indicates whether the add-on (also called an in-app product or IAP) is on sale.

Keywords Keywords Keywords Keywords Keywords

Gets the list of keywords associated with the add-on (also called an in-app product or IAP). These strings correspond to the value of the Keywords field in the properties page for the add-on in the Windows Dev Center dashboard. These keywords are useful for filtering product lists by keyword, for example, when calling LoadListingInformationByKeywordsAsync.

Name Name Name Name Name

Gets the descriptive name of the add-on (also called an in-app product or IAP) that is displayed customers in the current market.

ProductId ProductId ProductId ProductId ProductId

Gets the product ID for the add-on that this ProductListing represents.

ProductType ProductType ProductType ProductType ProductType

Gets the type of this add-on (also called an in-app product or IAP). Possible values are defined by ProductType.

SaleEndDate SaleEndDate SaleEndDate SaleEndDate SaleEndDate

Gets the end date of the sale period for the add-on (also called an in-app product or IAP).

Tag Tag Tag Tag Tag

Gets the custom developer data string (also called a tag) that contains custom information about an add-on (also called an in-app product or IAP). This string corresponds to the value of the Custom developer data field in the properties page for the add-on in the Windows Dev Center dashboard.

See Also