ProductListing ProductListing ProductListing ProductListing Class

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

Syntax

Declaration

public sealed class ProductListingpublic sealed class ProductListingPublic NotInheritable Class ProductListing

Remarks

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

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 + ".";

Properties summary

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

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

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

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

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

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

Gets the list of keywords associated with the add-on (also called an in-app product or IAP). These keywords are useful for filtering product lists by keyword, for example, when calling LoadListingInformationByKeywordsAsync(Windows.Foundation.Collections.IIterable{System.String}).

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

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

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

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

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.

Properties

  • CurrencyCode
    CurrencyCode
    CurrencyCode
    CurrencyCode

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

    public string CurrencyCode { get; }public string CurrencyCode { get; }Public ReadOnly Property CurrencyCode As string

    Property Value

    • string
      string
      string
      string

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

    Remarks

    The currency code string returned by this property conforms to ISO 4217.

  • Description
    Description
    Description
    Description

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

    public string Description { get; }public string Description { get; }Public ReadOnly Property Description As string

    Property Value

    • string
      string
      string
      string

      The description for the product.

  • 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.

    public string FormattedBasePrice { get; }public string FormattedBasePrice { get; }Public ReadOnly Property FormattedBasePrice As string

    Property Value

    • string
      string
      string
      string

      The base price for the add-on with the appropriate formatting for the current market.

    Remarks

    The base price is the default price for the add-on. If the add-on is on sale in the current market, use the FormattedPrice property to get the sale price. If the add-on is not on sale, FormattedBasePrice and FormattedPrice return the same value.

  • FormattedPrice
    FormattedPrice
    FormattedPrice
    FormattedPrice

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

    public string FormattedPrice { get; }public string FormattedPrice { get; }Public ReadOnly Property FormattedPrice As string

    Property Value

    • string
      string
      string
      string

      The purchase price with the appropriate formatting for the current market.

    Remarks

    If the in-app product is on sale in the current market, the FormattedPrice property returns the sale price. Use the FormattedBasePrice property to get the default price. If the in-app product is not on sale, FormattedBasePrice and FormattedPrice return the same value.

  • ImageUri
    ImageUri
    ImageUri
    ImageUri

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

    public Uri ImageUri { get; }public Uri ImageUri { get; }Public ReadOnly Property ImageUri As Uri

    Property Value

    • The URI to the image associated with the add-on.

  • IsOnSale
    IsOnSale
    IsOnSale
    IsOnSale

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

    public bool IsOnSale { get; }public bool IsOnSale { get; }Public ReadOnly Property IsOnSale As bool

    Property Value

    • bool
      bool
      bool
      bool

      Returns true if the in-app product is on sale, and otherwise false.

    Remarks

    For information about putting add-ons on sale, see Put apps and add-ons on sale.

  • Keywords
    Keywords
    Keywords
    Keywords

    Gets the list of keywords associated with the add-on (also called an in-app product or IAP). These keywords are useful for filtering product lists by keyword, for example, when calling LoadListingInformationByKeywordsAsync(Windows.Foundation.Collections.IIterable{System.String}).

    public IIterable<string> Keywords { get; }public IIterable<string> Keywords { get; }Public ReadOnly Property Keywords As IIterable<string>

    Property Value

    • The keywords associated with the in-app product.

  • 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.

    public string Name { get; }public string Name { get; }Public ReadOnly Property Name As string

    Property Value

    • string
      string
      string
      string

      The add-on's descriptive name as it is seen by customers in the current market.

  • ProductId
    ProductId
    ProductId
    ProductId

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

    public string ProductId { get; }public string ProductId { get; }Public ReadOnly Property ProductId As string

    Property Value

    • string
      string
      string
      string

      The product ID for the add-on.

  • 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.

    public ProductType ProductType { get; }public ProductType ProductType { get; }Public ReadOnly Property ProductType As ProductType

    Property Value

  • SaleEndDate
    SaleEndDate
    SaleEndDate
    SaleEndDate

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

    public DateTime SaleEndDate { get; }public DateTime SaleEndDate { get; }Public ReadOnly Property SaleEndDate As DateTime

    Property Value

  • 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.

    public string Tag { get; }public string Tag { get; }Public ReadOnly Property Tag As string

    Property Value

    • string
      string
      string
      string

      The custom developer data for the add-on.

    Remarks

    The custom developer data provides a way for developers to associate custom contextual information with an add-on. For more information about setting this value for an add-on, see Enter add-on properties.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.ApplicationModel.Store.dll