Examples

This code example 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.
// get one of the listing properties
thisAppsPrice = listing.formattedPrice;
}
);

// get the license info for this app from the simulator
ListingInformation listing = await CurrentAppSimulator.LoadListingInformationAsync();
// get the price of the app from the listing info.
String thisAppsPrice = listing.FormattedPrice;

Remarks

The info that this object returns comes from the listing info you enter when you submit the app to the Windows Store.

Note

The CurrentApp object obtains its data from the Windows Store, so you must have a Windows Store developer account and the app must be published in the Windows Store. If you don't have a Windows Store developer account, you can test the functions of this class by using the CurrentAppSimulator.

The app's base price with the appropriate formatting for the current market and currency.

Additional features and requirements

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 app. If the app is on sale in the current market, use the FormattedPrice property to get the sale price. If the app is not on sale, FormattedBasePrice and FormattedPrice return the same value.