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

Muestra una interfaz de usuario del sistema para resolver problemas de tokens con una dirección URL no Unicode.

## Sintaxis

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

### Parámetros

*user*   \_In\_\
Tipo: XUserHandle

Un identificador del usuario con el problema de token.

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

Para problemas de XBOX Live como el consentimiento, pase **nullptr**. De lo contrario, establézcalo en la dirección URL de la solicitud web que crea el problema.

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

Un [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) para sondear el estado de la llamada y recuperar los resultados de la llamada.

### Valor devuelto

Tipo: HRESULT

Devuelve S\_OK si la operación se realiza correctamente; de lo contrario, devuelve un código de error. Para obtener una lista de los códigos de error, consulte [Códigos de error](/reference/errorcodes).

## Comentarios

Para devolver el resultado que devuelve XUserResolveIssueWithUiAsync, llame a [XUserResolveIssueWithUiResult](/reference/system/xuser/functions/xuserresolveissuewithuiresult).
Si una API de XUsers devuelve un error E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED, el usuario debe interactuar con la interfaz de usuario (UI) del sistema para resolver el problema.
Llame a **XUserResolveIssueWithUiAsync** para mostrar la interfaz de usuario del sistema adecuada.

Para mostrar una interfaz de usuario del sistema para resolver problemas de tokens con una dirección URL Unicode, llame a [XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async).

En el ejemplo siguiente se muestra cómo mostrar la interfaz de usuario del sistema para resolver problemas de tokens con una dirección 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

**Encabezado:** XUser.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** Windows, Steam Deck, consolas de la familia XBOX One y consolas XBOX Series

## Documentación conceptual

* [Uso de la API de C++ de Game Chat 2](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2)

## Consulte también

[XUser](/reference/system/xuser/xuser_members)

[XUserResolveIssueWithUiResult](/reference/system/xuser/functions/xuserresolveissuewithuiresult)

[XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async)


## Related topics

- [XUserResolveIssueWithUiResult](/es/reference/system/xuser/functions/xuserresolveissuewithuiresult.md)
- [XUserResolveIssueWithUiUtf16Async](/es/reference/system/xuser/functions/xuserresolveissuewithuiutf16async.md)
- [XUserResolveIssueWithUiUtf16Result](/es/reference/system/xuser/functions/xuserresolveissuewithuiutf16result.md)
- [XUserGetAgeGroup](/es/reference/system/xuser/functions/xusergetagegroup.md)
- [XUserCheckPrivilege](/es/reference/system/xuser/functions/xusercheckprivilege.md)
