CurrentApp CurrentApp CurrentApp CurrentApp CurrentApp Class

Definition

Defines methods and properties you can use to get license and listing info about the current app and perform in-app product purchases.

Note

The CurrentApp class and the other types in the Windows.ApplicationModel.Store namespace are no longer being updated with new features. If your project targets Windows 10 Anniversary Edition (10.0; Build 14393) or a later release in Visual Studio (that is, you are targeting Windows 10, version 1607, or later), we recommend that you use the Windows.Services.Store namespace instead. For more information, see In-app purchases and trials. The CurrentApp class is not supported in Windows desktop applications that use the Desktop Bridge or in apps or games that use a development sandbox in Dev Center (for example, this is the case for any game that integrates with Xbox Live). These products must use the Windows.Services.Store namespace to implement in-app purchases and trials.

public : static class CurrentApp
static struct winrt::Windows::ApplicationModel::Store::CurrentApp
public static class CurrentApp
Public Shared Class CurrentApp
// 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)

Remarks

This object obtains its data from the Microsoft Store, so you must have a developer account and the app must be published in the Microsoft Store. Before submitting to the Microsoft Store, you can test your code with a simulated version of this class (whose state is initialized from an XML file). See CurrentAppSimulator.

Properties

AppId AppId AppId AppId AppId

Gets the GUID generated by the Windows Store when your app has been certified for listing in the Windows Store.

Note

Once your app is in the Windows Store, future app updates or changes to the app description will not result in a change to the CurrentApp.AppId.

LicenseInformation LicenseInformation LicenseInformation LicenseInformation LicenseInformation

Gets the license metadata for the current app.

LinkUri LinkUri LinkUri LinkUri LinkUri

Gets the Uniform Resource Identifier (URI) of the app's listing page in the web catalog of the Windows Store.

Methods

GetAppPurchaseCampaignIdAsync() GetAppPurchaseCampaignIdAsync() GetAppPurchaseCampaignIdAsync() GetAppPurchaseCampaignIdAsync() GetAppPurchaseCampaignIdAsync()

Retrieves the promotion campaign ID for the current app.

GetAppReceiptAsync() GetAppReceiptAsync() GetAppReceiptAsync() GetAppReceiptAsync() GetAppReceiptAsync()

Requests all receipts for the purchase of the app and any in-app products. For examples of how receipt information can be used, see Using receipts to verify product purchases.

GetCustomerCollectionsIdAsync(String, String) GetCustomerCollectionsIdAsync(String, String) GetCustomerCollectionsIdAsync(String, String) GetCustomerCollectionsIdAsync(String, String) GetCustomerCollectionsIdAsync(String, String)

Retrieves a Microsoft Store ID key that can be used to query for product entitlements or to consume product entitlements that are owned by the current user.

GetCustomerPurchaseIdAsync(String, String) GetCustomerPurchaseIdAsync(String, String) GetCustomerPurchaseIdAsync(String, String) GetCustomerPurchaseIdAsync(String, String) GetCustomerPurchaseIdAsync(String, String)

Retrieves a Microsoft Store ID key that can be used to grant entitlements for free products on behalf of the current user.

GetProductReceiptAsync(String) GetProductReceiptAsync(String) GetProductReceiptAsync(String) GetProductReceiptAsync(String) GetProductReceiptAsync(String)

Requests the receipt for the specified product ID. For examples of how receipt information can be used, see Using receipts to verify product purchases.

GetUnfulfilledConsumablesAsync() GetUnfulfilledConsumablesAsync() GetUnfulfilledConsumablesAsync() GetUnfulfilledConsumablesAsync() GetUnfulfilledConsumablesAsync()

Returns a list of purchased consumable in-app products that have not been reported to the Microsoft Store as fulfilled.

LoadListingInformationAsync() LoadListingInformationAsync() LoadListingInformationAsync() LoadListingInformationAsync() LoadListingInformationAsync()

Loads the app's listing information asynchronously.

The returned ListingInformation object contains listing information (e.g. name, price, age rating) specific to the market the user currently resides in. Additionally, the listing information for available in-app products is also provided.

LoadListingInformationByKeywordsAsync(IIterable<String>) LoadListingInformationByKeywordsAsync(IIterable<String>) LoadListingInformationByKeywordsAsync(IIterable<String>) LoadListingInformationByKeywordsAsync(IIterable<String>) LoadListingInformationByKeywordsAsync(IIterable<String>)

Loads the app listing information asynchronously, returning features and products in the ProductListings collection that match all supplied keywords.

LoadListingInformationByProductIdsAsync(IIterable<String>) LoadListingInformationByProductIdsAsync(IIterable<String>) LoadListingInformationByProductIdsAsync(IIterable<String>) LoadListingInformationByProductIdsAsync(IIterable<String>) LoadListingInformationByProductIdsAsync(IIterable<String>)

Loads the app listing information asynchronously, returning features and products in the ProductListings collection that match any of the given products IDs.

ReportConsumableFulfillmentAsync(String, Guid) ReportConsumableFulfillmentAsync(String, Guid) ReportConsumableFulfillmentAsync(String, Guid) ReportConsumableFulfillmentAsync(String, Guid) ReportConsumableFulfillmentAsync(String, Guid)

Notifies the Microsoft Store that the purchase of a consumable add-on (also called an in-app product or IAP) is fulfilled and that the user has the right to access the content.

ReportProductFulfillment(String) ReportProductFulfillment(String) ReportProductFulfillment(String) ReportProductFulfillment(String) ReportProductFulfillment(String)

Notifies the Microsoft Store that the application has fulfilled the in-app product. This product cannot be re-purchased until the app has confirmed fulfillment using this method.

RequestAppPurchaseAsync(Boolean) RequestAppPurchaseAsync(Boolean) RequestAppPurchaseAsync(Boolean) RequestAppPurchaseAsync(Boolean) RequestAppPurchaseAsync(Boolean)

Requests the purchase of a full app license.

RequestProductPurchaseAsync(String) RequestProductPurchaseAsync(String) RequestProductPurchaseAsync(String) RequestProductPurchaseAsync(String) RequestProductPurchaseAsync(String)

Requests the purchase of an add-on (also called an in-app product or IAP). Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store.

RequestProductPurchaseAsync(String, Boolean) RequestProductPurchaseAsync(String, Boolean) RequestProductPurchaseAsync(String, Boolean) RequestProductPurchaseAsync(String, Boolean) RequestProductPurchaseAsync(String, Boolean)

Note

RequestProductPurchaseAsync(String, Boolean) may be altered or unavailable for releases after Windows 8.1. Instead, use RequestProductPurchaseAsync(String).

Requests the purchase of an add-on (also called an in-app product or IAP). Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store.

RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties) RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties) RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties) RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties) RequestProductPurchaseAsync(String, String, ProductPurchaseDisplayProperties)

Requests the purchase of an add-on (also called an in-app product or IAP). Additionally, calling this method displays the UI that is used to complete the transaction via the Microsoft Store. This overload includes parameters you can use to display details for a specific offer within a large catalog of in-app purchases that is represented by a single product entry in the Store.

See Also