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

# XUserResolveIssueWithUiAsync

> XUserResolveIssueWithUiAsync

# XUserResolveIssueWithUiAsync

Exibe uma interface do usuário do sistema para resolver problemas de token com uma URL não Unicode.

## Sintaxe

```cpp theme={null}
HRESULT XUserResolveIssueWithUiAsync(  
         XUserHandle user,  
         const char* url,  
         XAsyncBlock* async  
)  
```

### Parâmetros

*user*   \_In\_\
Tipo: XUserHandle

Um identificador para o usuário com o problema de token.

*url*   \_In\_opt\_z\_\
Tipo: char\*

Para problemas do XBOX Live, como consentimento, passe **nullptr**. Caso contrário, defina como a URL da solicitação da Web que cria o problema.

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

Um [XAsyncBlock](/pt-BR/reference/system/xasync/structs/xasyncblock) para sondar o status da chamada e recuperar os resultados da chamada.

### Valor retornado

Tipo: HRESULT

Retornará S\_OK se for bem-sucedido; caso contrário, retornará um código de erro. Para obter uma lista de códigos de erro, confira [Códigos de erro](/pt-BR/reference/errorcodes).

## Comentários

Para retornar o resultado que XUserResolveIssueWithUiAsync retorna, chame [XUserResolveIssueWithUiResult](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiresult).
Se uma API XUsers retornar um erro E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED, o usuário deverá interagir com a interface do usuário (IU) do sistema para resolver o problema.
Chame **XUserResolveIssueWithUiAsync** para mostrar a IU do sistema apropriada.

Para exibir uma interface do usuário do sistema para resolver problemas de token com uma URL Unicode, chame [XUserResolveIssueWithUiUtf16Async](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16async).

O exemplo a seguir demonstra como exibir a IU do sistema para resolver problemas de token com uma URL.

```cpp theme={null}
HRESULT ResolveUserIssueComplete(XAsyncBlock* ab)
{
    if (SUCCEEDED_LOG(XUserResolveIssueWithUiResult(ab)))
    {
        appLog.AddLog("Successfully Resolved User Issue\n");
    }

    return S_OK;
}

HRESULT ResolveUserIssueUtf16Complete(XAsyncBlock* ab)
{
    if (SUCCEEDED_LOG(XUserResolveIssueWithUiUtf16Result(ab)))
    {
        appLog.AddLog("Successfully Resolved User Issue\n");
    }

    return S_OK;
}

HRESULT ResolveUserIssueWithUiAsync(
    XTaskQueueHandle queue,
    const char* narrowUrl = nullptr,
    const wchar_t* wideUrl = nullptr,
    bool useUtf16 = false)
{
    auto resolveAsyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(resolveAsyncBlock.get(), sizeof(*resolveAsyncBlock));
    resolveAsyncBlock->queue = queue;
    resolveAsyncBlock->context = this;

    if (useUtf16)
    {
        resolveAsyncBlock->callback = [](XAsyncBlock* ab)
        {
            auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab);
            LOG_IF_FAILED(static_cast<User*>(ab->context)->ResolveUserIssueUtf16Complete(ab));
        };

        if (SUCCEEDED_LOG(XUserResolveIssueWithUiUtf16Async(
            _handle.get(),
            wideUrl,
            resolveAsyncBlock.get())))
        {
            // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
            // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
            resolveAsyncBlock.release();
        }
    }
    else
    {
        resolveAsyncBlock->callback = [](XAsyncBlock* ab)
        {
            auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab);
            LOG_IF_FAILED(static_cast<User*>(ab->context)->ResolveUserIssueComplete(ab));
        };

        if (SUCCEEDED_LOG(XUserResolveIssueWithUiAsync(
            _handle.get(),
            narrowUrl,
            resolveAsyncBlock.get())))
        {
            // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
            // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
            resolveAsyncBlock.release();
        }
    }

    return S_OK;
}
```

## Requisitos

**Cabeçalho:** XUser.h

**Biblioteca:** xgameruntime.lib

**Plataformas com suporte:** Windows, Steam Deck, consoles da família XBOX One e consoles XBOX Series

## Documentação conceitual

* [Como usar a API C++ do Game Chat 2](/pt-BR/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2)

## Confira também

[XUser](/pt-BR/reference/system/xuser/xuser_members)

[XUserResolveIssueWithUiResult](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiresult)

[XUserResolveIssueWithUiUtf16Async](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16async)


## Related topics

- [XUserResolveIssueWithUiAsync](/reference/system/xuser/functions/xuserresolveissuewithuiasync.md)
- [XUserResolveIssueWithUiResult](/reference/system/xuser/functions/xuserresolveissuewithuiresult.md)
