StoreContext.GetStoreProductsAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| GetStoreProductsAsync(IIterable<String>, IIterable<String>) |
取得與目前應用程式相關的指定產品的 Microsoft Store 列表資訊。 |
| GetStoreProductsAsync(IIterable<String>, IIterable<String>, StoreProductOptions) |
取得與目前應用程式相關的指定產品的 Microsoft Store 列表資訊,並提供使用篩選器查詢的選項。 |
GetStoreProductsAsync(IIterable<String>, IIterable<String>)
取得與目前應用程式相關的指定產品的 Microsoft Store 列表資訊。
public:
virtual IAsyncOperation<StoreProductQueryResult ^> ^ GetStoreProductsAsync(IIterable<Platform::String ^> ^ productKinds, IIterable<Platform::String ^> ^ storeIds) = GetStoreProductsAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreProductQueryResult> GetStoreProductsAsync(IIterable<winrt::hstring> const& productKinds, IIterable<winrt::hstring> const& storeIds);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreProductQueryResult> GetStoreProductsAsync(IEnumerable<string> productKinds, IEnumerable<string> storeIds);
function getStoreProductsAsync(productKinds, storeIds)
Public Function GetStoreProductsAsync (productKinds As IEnumerable(Of String), storeIds As IEnumerable(Of String)) As IAsyncOperation(Of StoreProductQueryResult)
參數
一組字串陣列,用來指定你想要取得商品列表資訊的類型。 有關支援的字串值清單,請參見 ProductKind 屬性。
傳回
一個非同步操作,成功完成後會回傳一個 StoreProductQueryResult 物件,該物件包含指定產品的清單資訊及相關錯誤資訊。
- 屬性
備註
此方法會回傳與目前應用程式相關的指定商品的列表資訊,無論該產品是否在目前應用程式中可購買。 若要取得目前應用程式內所有可購買產品的資訊,請使用 GetStoreProductsAsync overload 或 GetAssociatedStoreProductsAsync 方法。
產品的商店 ID 可在合作夥伴中心取得,且該 StoreProduct 的 StoreId 屬性也會回傳該產品。 欲了解更多資訊,請參閱店鋪識別。
關於使用此方法的更多資訊,包括程式碼範例,請參閱 「獲取應用程式與附加元件的產品資訊」。
另請參閱
適用於
GetStoreProductsAsync(IIterable<String>, IIterable<String>, StoreProductOptions)
取得與目前應用程式相關的指定產品的 Microsoft Store 列表資訊,並提供使用篩選器查詢的選項。
public:
virtual IAsyncOperation<StoreProductQueryResult ^> ^ GetStoreProductsAsync(IIterable<Platform::String ^> ^ productKinds, IIterable<Platform::String ^> ^ storeIds, StoreProductOptions ^ storeProductOptions) = GetStoreProductsAsync;
/// [Windows.Foundation.Metadata.Overload("GetStoreProductsWithOptionsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<StoreProductQueryResult> GetStoreProductsAsync(IIterable<winrt::hstring> const& productKinds, IIterable<winrt::hstring> const& storeIds, StoreProductOptions const& storeProductOptions);
[Windows.Foundation.Metadata.Overload("GetStoreProductsWithOptionsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<StoreProductQueryResult> GetStoreProductsAsync(IEnumerable<string> productKinds, IEnumerable<string> storeIds, StoreProductOptions storeProductOptions);
function getStoreProductsAsync(productKinds, storeIds, storeProductOptions)
Public Function GetStoreProductsAsync (productKinds As IEnumerable(Of String), storeIds As IEnumerable(Of String), storeProductOptions As StoreProductOptions) As IAsyncOperation(Of StoreProductQueryResult)
參數
一組字串陣列,用來指定你想要取得商品列表資訊的類型。 有關支援的字串值清單,請參見 ProductKind 屬性。
- storeProductOptions
- StoreProductOptions
一個包含用於查詢的過濾器的物件。
傳回
一個非同步操作,成功完成後會回傳一個 StoreProductQueryResult 物件,該物件包含指定產品的清單資訊及相關錯誤資訊。
- 屬性
Windows 需求
| 規格需求 | Description |
|---|---|
| 裝置系列 |
Windows 10, version 1803 (已於 10.0.17134.0 引進)
|
| API contract |
Windows.Services.Store.StoreContract (已於 v3.0 引進)
|
備註
若要只回傳目前應用程式中可購買的產品資訊,請將Purchase篩選字串加入你傳遞給 storeProductOptions 參數的物件 ActionFilters 屬性。 要取得所有與目前應用程式相關的指定產品資訊,不論是否目前可購買,請使用 GetStoreProductsAsync 過載。
產品的商店 ID 可在合作夥伴中心取得,且該 StoreProduct 的 StoreId 屬性也會回傳該產品。 欲了解更多資訊,請參閱店鋪識別。
關於使用此方法的更多資訊,包括程式碼範例,請參閱 「獲取應用程式與附加元件的產品資訊」。