> ## 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

Dispara o resgate de um token especificado para o usuário atual.

## Sintaxe

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

### Parâmetros

*storeContextHandle*   \_In\_\
Tipo: XStoreContextHandle

O identificador de contexto da loja para o usuário retornado por [XStoreCreateContext](/pt-BR/reference/system/xstore/functions/xstorecreatecontext).

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

O token a ser resgatado. Este valor não pode ser vazio nem nulo; se você quiser abrir a interface do usuário sem fornecer um código para preencher previamente na interface, passe um único espaço " ".

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

Permite restringir os códigos 5x5 para que funcionem apenas com produtos específicos.

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

O número de elementos em **allowedStoreIds**.

*disallowCsvRedemption*   \_In\_\
Tipo: bool

Impede que CSV (códigos 5x5 do tipo cartão-presente/dinheiro) sejam resgatados.

*async*   \_Inout\_\
Tipo: [XAsyncBlock\*](/pt-BR/reference/system/xasync/structs/xasyncblock)

Um [XAsyncBlock](/pt-BR/reference/system/xasync/structs/xasyncblock) que define o trabalho assíncrono que está sendo feito. O [XAsyncBlock](/pt-BR/reference/system/xasync/structs/xasyncblock) pode ser usado para sondar o status da chamada e recuperar os resultados da chamada. Consulte [XAsyncBlock](/pt-BR/reference/system/xasync/structs/xasyncblock) para obter mais informações.

### Valor retornado

Tipo: HRESULT

Código de êxito ou de erro HRESULT.

## Comentários

Para recuperar o resultado da execução desta função, chame [XStoreShowRedeemTokenUIResult](/pt-BR/reference/system/xstore/functions/xstoreshowredeemtokenuiresult) após chamar esta função.

O trecho de código a seguir mostra um exemplo de inicialização da interface do usuário de resgate de token.

```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;
    }
}


```

## Requisitos

**Cabeçalho:** XStore.h (incluído em XGameRuntime.h)

**Biblioteca:** xgameruntime.lib

**Plataformas compatíveis:** Windows, consoles da família XBOX One e consoles XBOX Series

## Confira também

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


## Related topics

- [XStoreShowRedeemTokenUIAsync](/reference/system/xstore/functions/xstoreshowredeemtokenuiasync.md)
- [XStoreShowRedeemTokenUIResult](/reference/system/xstore/functions/xstoreshowredeemtokenuiresult.md)
- [XStore](/reference/system/xstore/xstore_members.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
