StoreContext.FindStoreProductForPackageAsync(IEnumerable<String>, Package) Method

Definition

Gets Store product details for the app or add-on that is associated with the specified package.

public:
 virtual IAsyncOperation<StoreProductResult ^> ^ FindStoreProductForPackageAsync(IIterable<Platform::String ^> ^ productKinds, Package ^ package) = FindStoreProductForPackageAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreProductResult> FindStoreProductForPackageAsync(IIterable<winrt::hstring> const & productKinds, Package const & package);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreProductResult> FindStoreProductForPackageAsync(IEnumerable<string> productKinds, Package package);
function findStoreProductForPackageAsync(productKinds, package)
Public Function FindStoreProductForPackageAsync (productKinds As IEnumerable(Of String), package As Package) As IAsyncOperation(Of StoreProductResult)

Parameters

productKinds
IEnumerable<String>

An array of strings that specify the types of Store products that might be associated with the package. For a list of the supported string values, see the ProductKind property.

package
Package

A Package that represents the package for which you want to get the corresponding Store product details.

Returns

IAsyncOperation<StoreProductResult>

An asynchronous operation that, on successful completion, returns a StoreProductResult object. Use the Product property of this object to access a StoreProduct that contains Store product details for the specified package.

Attributes

Windows 10 requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Services.Store.StoreContract (introduced in v2.0)

Remarks

Use this method to get Store product details (such as the Store ID) for a package that is associated with the current app or an add-on for the current app. This method may return errors if the package is not associated with the current app, the current device is offline, or if the current app was not installed from the Store (for example, if the app was sideloaded). In these cases, you can examine the ExtendedError property of the StoreProductResult return object to get more details about the error.

Applies to

See also