Delen via


ProductListing Class

Definition

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

public ref class ProductListing sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ProductListing final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ProductListing
Public NotInheritable Class ProductListing
Inheritance
Object Platform::Object IInspectable ProductListing
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

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

Version history

Windows version SDK version Value added
1511 10586 CurrencyCode
1511 10586 FormattedBasePrice
1511 10586 IsOnSale
1511 10586 SaleEndDate

Properties

CurrencyCode

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

Description

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

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

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

ImageUri

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

IsOnSale

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

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 Partner Center. These keywords are useful for filtering product lists by keyword, for example, when calling LoadListingInformationByKeywordsAsync.

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

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

ProductType

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

SaleEndDate

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

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 Partner Center.

Applies to

See also