> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XStoreShowRedeemTokenUIAsync

> XStoreShowRedeemTokenUIAsync

# XStoreShowRedeemTokenUIAsync

指定したトークンに対して、現在のユーザーによるトークンの引き換えをトリガーします。

## Syntax

```cpp theme={null}
HRESULT XStoreShowRedeemTokenUIAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char* token,  
         const char** allowedStoreIds,  
         size_t allowedStoreIdsCount,  
         bool disallowCsvRedemption,  
         XAsyncBlock* async  
)  
```

### Parameters

*storeContextHandle*   \_In\_\
型: XStoreContextHandle

[XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext) によって返されたユーザーのストア コンテキスト ハンドル。

*token*   \_In\_z\_\
型: char\*

引き換えるトークン。この値を空または null にすることはできません。UI に事前入力するコードを指定せずに UI を表示したい場合は、単一のスペース " " を渡してください。

*allowedStoreIds*   \_In\_z\_count\_(allowedStoreIdsCount)\
型: char\*\*

5x5 コードを特定の製品のみで機能するように制限できます。

*allowedStoreIdsCount*   \_In\_\
型: size\_t

**allowedStoreIds** 内の要素数。

*disallowCsvRedemption*   \_In\_\
型: bool

CSV (ギフト カード / 通貨形式の 5x5) の引き換えを防ぎます。

*async*   \_Inout\_\
型: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

実行される非同期処理を定義する [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。[XAsyncBlock](/reference/system/xasync/structs/xasyncblock) を使用して呼び出しの状態をポーリングしたり、呼び出し結果を取得したりできます。詳細については、[XAsyncBlock](/reference/system/xasync/structs/xasyncblock) を参照してください。

### Return value

型: HRESULT

HRESULT の成功またはエラー コード。

## Remarks

この関数の実行結果を取得するには、この関数を呼び出した後に [XStoreShowRedeemTokenUIResult](/reference/system/xstore/functions/xstoreshowredeemtokenuiresult) を呼び出します。

次のコード スニペットは、トークン引き換え UI を起動する例を示しています。

```cpp theme={null}
void CALLBACK ShowRedeemTokenUICallback(XAsyncBlock* asyncBlock)
{
    HRESULT hr = XStoreShowRedeemTokenUIResult(asyncBlock);

    if (FAILED(hr))
    {
        printf("Failed redeem token: 0x%x\r\n", hr);
        return;
    }
}

void ShowRedeemTokenUI(XStoreContextHandle storeContextHandle, XTaskQueueHandle taskQueueHandle, const char* token)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = taskQueueHandle;
    asyncBlock->callback = ShowRedeemTokenUICallback;

    HRESULT hr = XStoreShowRedeemTokenUIAsync(
        storeContextHandle,
        token,
        nullptr,    // Can restrict to specific store IDs
        0,
        false,      // Can prevent CSV (cash gift cards)
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed to request redeem token: 0x%x\r\n", hr);
        return;
    }
}


```

## Requirements

**ヘッダー:** XStore.h (XGameRuntime.h に含まれる)

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## See also

[XStore](/reference/system/xstore/xstore_members)\
[XStoreShowRedeemTokenUIResult](/reference/system/xstore/functions/xstoreshowredeemtokenuiresult)


## Related topics

- [XStoreShowRedeemTokenUIResult](/ja-jp/reference/system/xstore/functions/xstoreshowredeemtokenuiresult.md)
- [XStore](/ja-jp/reference/system/xstore/xstore_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [PFInventoryRedeemMicrosoftStoreInventoryItemsRequest](/ja-jp/services/playfab/api-references/c/pfinventorytypes/structs/pfinventoryredeemmicrosoftstoreinventoryitemsrequest.md)
- [XStoreShowGiftingUIAsync](/ja-jp/reference/system/xstore/functions/xstoreshowgiftinguiasync.md)
