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, IProductListingWithMetadatapublic sealed class ProductListing : IProductListing, IProductListing2, IProductListingWithMetadataPublic NotInheritable Class ProductListing Implements IProductListing, IProductListing2, IProductListingWithMetadata// You can use this class in JavaScript.
- Attributes
| 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
Gets the currency code associated with the user's market, such as USD or CAD.
public : PlatForm::String CurrencyCode { get; }public string CurrencyCode { get; }Public ReadOnly Property CurrencyCode As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The currency code associated with the user's market, such as USD or CAD.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
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 : PlatForm::String Description { get; }public string Description { get; }Public ReadOnly Property Description As string// You can use this property in JavaScript.
- Value
- PlatForm::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 : PlatForm::String FormattedBasePrice { get; }public string FormattedBasePrice { get; }Public ReadOnly Property FormattedBasePrice As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The base price for the add-on with the appropriate formatting for the current market.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
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 : PlatForm::String FormattedPrice { get; }public string FormattedPrice { get; }Public ReadOnly Property FormattedPrice As string// You can use this property in JavaScript.
- Value
- PlatForm::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// You can use this property in JavaScript.
- Value
- Uri Uri Uri Uri
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 : PlatForm::Boolean IsOnSale { get; }public bool IsOnSale { get; }Public ReadOnly Property IsOnSale As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
Returns true if the in-app product is on sale, and otherwise false.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
Remarks
For information about putting add-ons on sale, see Put apps and add-ons on sale.
- See Also
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.
public : IIterable<string> Keywords { get; }public IEnumerable<string> Keywords { get; }Public ReadOnly Property Keywords As IEnumerable<string>// You can use this property in JavaScript.
- Value
- IIterable<PlatForm::String> IEnumerable<string> IEnumerable<string> IEnumerable<string>
The keywords associated with the add-on.
Remarks
For more information about setting the keywords for an add-on in the dashboard, see Enter add-on properties.
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 : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string// You can use this property in JavaScript.
- Value
- PlatForm::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 that this ProductListing represents.
public : PlatForm::String ProductId { get; }public string ProductId { get; }Public ReadOnly Property ProductId As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The product ID for the add-on.
Remarks
The product ID is the string that the app uses to identify the add-on. You enter the product ID when submitting your add-on in the Windows Dev Center dashboard, where it is associated with the description, price tier and lifetime. For more information, see How to use product IDs for add-ons in your code.
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// You can use this property in JavaScript.
The product type. Possible values include Consumable and Durable.
- See Also
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 DateTimeOffset SaleEndDate { get; }Public ReadOnly Property SaleEndDate As DateTimeOffset// You can use this property in JavaScript.
- Value
- DateTime DateTimeOffset DateTimeOffset DateTimeOffset
The date and time that the add-on's sale period will end.
| Device family |
Windows 10 (introduced v10.0.10586.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v2)
|
- See Also
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 : PlatForm::String Tag { get; }public string Tag { get; }Public ReadOnly Property Tag As string// You can use this property in JavaScript.
- Value
- PlatForm::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.