CurrentApp class

CurrentApp class

Defines methods and properties you can use to get license and listing info about the current app and perform in-app product purchases. This object obtains its data from the Windows Store, so you must have a developer account and the app must be published in the Windows Store. Before submitting to the Windows Store, you can test your code with a simulated version of this class (whose state is initialized from an xml file). See CurrentAppSimulator.

Note  If your app targets Windows 10, version 1607 or later, we recommend that you use members of the Windows.Services.Store namespace instead of the Windows.ApplicationModel.Store namespace. The Windows.Services.Store namespace supports the latest add-on types, such as Store-managed consumable add-ons, and is designed to be compatible with future types of products and features supported by Windows Dev Center and the Store. The Windows.Services.Store namespace is also designed to have better performance. For more information, see In-app purchases and trials.
 

Syntax


public static class CurrentApp

Members

The CurrentApp class has these types of members:

Methods

The CurrentApp class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetAppPurchaseCampaignIdAsync Retrieves the promotion campaign ID for the current app.
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 Retrieves a Windows Store collections ID key that can be used to query for product entitlements or to consume product entitlements that are owned by the current user.
GetCustomerPurchaseIdAsync Retrieves a Windows Store purchase ID key that can be used to grant entitlements for free products on behalf of the current user.
GetProductReceiptAsync Requests the receipt for the specified product ID.
GetUnfulfilledConsumablesAsync Returns a list of purchased consumable in-app products that have not been reported to the Windows Store as fulfilled.
LoadListingInformationAsync Loads the app's listing information asynchronously. Implements the IAsyncInfo interface.
LoadListingInformationByKeywordsAsync Windows Phone only. Loads the app listing information asynchronously, returning features and products in the ProductListings collection that match all supplied keywords. Implements the IAsyncInfo interface.
LoadListingInformationByProductIdsAsync Windows Phone only. Loads the app listing information asynchronously, returning features and products in the ProductListings collection that match any of the given products IDs. Implements the IAsyncInfo interface.
ReportConsumableFulfillmentAsync Notifies the Windows Store that the purchase of a consumable is fulfilled and that the user has the right to access the content.
ReportProductFulfillment Notifies the Windows 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 Requests the purchase of a full app license.
RequestProductPurchaseAsync(String) Requests the purchase of an in-app product. Additionally, calling this method displays the UI that is used to complete the transaction via the Windows Store.
RequestProductPurchaseAsync(String,Boolean) Requests the purchase of an in-app product. Additionally, calling this method displays the UI that is used to complete the transaction via the Windows Store.
RequestProductPurchaseAsync(String,String,ProductPurchaseDisplayProperties) Requests the purchase of an in-app product. Additionally, calling this method displays the UI that is used to complete the transaction via the Windows Store.

 

Properties

The CurrentApp class has these properties.

PropertyAccess typeDescription

AppId

Read-only

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

LicenseInformation

Read-only

Gets the license metadata for the current app.

LinkUri

Read-only

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

 

Remarks

This object obtains its information from the Windows Store.

Note  The CurrentApp class is not supported in Windows desktop applications that use the Desktop Bridge. These applications must use the Windows.Services.Store namespace to implement in-app purchases and trials. For more information, see In-app purchases and trials.
 

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Store
Windows::ApplicationModel::Store [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8

Namespace

Windows.ApplicationModel.Store
Windows::ApplicationModel::Store [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

See also

Object
Store sample (UWP)
Trial app and in-app purchase sample (Windows 8.1)

 

 

Show:
© 2016 Microsoft