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

Unicode 以外の URL でのトークンに関する問題を解決するシステム ユーザー インターフェイスを表示します。

## 構文

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

### パラメーター

*user*   \_In\_\
Type: XUserHandle

トークンの問題を抱えるユーザーのハンドルです。

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

同意 (consent) など、XBOX Live の問題については **nullptr** を渡します。それ以外の場合は、問題を発生させた Web 要求の URL を設定します。

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

呼び出しの状態のポーリングと呼び出し結果の取得に使用する [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) です。

### 戻り値

Type: HRESULT

成功した場合は S\_OK を返します。それ以外の場合はエラー コードを返します。エラー コードの一覧については、[エラー コード](/reference/errorcodes) を参照してください。

## 解説

XUserResolveIssueWithUiAsync が返す結果を取得するには、[XUserResolveIssueWithUiResult](/reference/system/xuser/functions/xuserresolveissuewithuiresult) を呼び出します。
XUsers API が E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED エラーを返す場合、ユーザーはシステム ユーザー インターフェイス (UI) を操作して問題を解決する必要があります。
**XUserResolveIssueWithUiAsync** を呼び出して、適切なシステム UI を表示してください。

Unicode URL でのトークンに関する問題を解決するシステム ユーザー インターフェイスを表示するには、[XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async) を呼び出します。

以下の例は、URL を指定してトークンに関する問題を解決するシステム UI を表示する方法を示しています。

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

## 要件

**ヘッダー:** XUser.h

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

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

## 概念ドキュメント

* [Game Chat 2 C++ API の使用](/services/xbox-services/multiplayer/chat/game-chat2/using-game-chat-2)

## 関連項目

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

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

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


## Related topics

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