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

# 提交信譽意見反應

> 呼叫 XblSocialSubmitReputationFeedbackAsync，從您的 XBOX 遊戲傳送正面或負面玩家信譽意見反應的 XSAPI C 範例。

## 提交單一信譽意見反應

**C API**

```cpp theme={null}
auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock }; // Take over ownership of the XAsyncBlock*
    HRESULT hr = XAsyncGetStatus(asyncBlock, false);
};

uint64_t xuid{ 123 };
HRESULT hr = XblSocialSubmitReputationFeedbackAsync(
    xboxLiveContext,
    xuid,
    XblReputationFeedbackType::PositiveHelpfulPlayer,
    nullptr,
    "Helpful player",
    nullptr,
    asyncBlock.get()
);
if (SUCCEEDED(hr))
{
    // 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*
    asyncBlock.release();
}
```

**參考**

* [XAsyncBlock](/zh-TW/reference/system/xasync/structs/xasyncblock)
* [XAsyncGetStatus](/zh-TW/reference/system/xasync/functions/xasyncgetstatus)
* [XblReputationFeedbackType](/zh-TW/reference/live/xsapi-c/social_c/enums/xblreputationfeedbacktype)
* [XblSocialSubmitReputationFeedbackAsync](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialsubmitreputationfeedbackasync)

## 提交多個信譽意見反應項目

**C API**

```cpp theme={null}
std::vector<XblReputationFeedbackItem> feedbackItems;
feedbackItems.push_back(XblReputationFeedbackItem
    {
        123,
        XblReputationFeedbackType::PositiveHelpfulPlayer,
        nullptr,
        "Helpful player",
        nullptr
    });
// Add any additional feedback items here

auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock }; // Take over ownership of the XAsyncBlock*
    HRESULT hr = XAsyncGetStatus(asyncBlock, false);
};

HRESULT hr = XblSocialSubmitBatchReputationFeedbackAsync(
    xboxLiveContext,
    feedbackItems.data(),
    feedbackItems.size(),
    asyncBlock.get()
);
if (SUCCEEDED(hr))
{
    // 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*
    asyncBlock.release();
}
```

**參考**

* [XAsyncBlock](/zh-TW/reference/system/xasync/structs/xasyncblock)
* [XAsyncGetStatus](/zh-TW/reference/system/xasync/functions/xasyncgetstatus)
* [XblReputationFeedbackItem](/zh-TW/reference/live/xsapi-c/social_c/structs/xblreputationfeedbackitem)
* [XblReputationFeedbackType](/zh-TW/reference/live/xsapi-c/social_c/enums/xblreputationfeedbacktype)
* [XblSocialSubmitBatchReputationFeedbackAsync](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialsubmitbatchreputationfeedbackasync)


## Related topics

- [信譽範例程式碼](/zh-TW/services/xbox-services/community/reputation/how-to/live-reputation-howto-nav.md)
- [操作說明](/zh-TW/services/xbox-services/community/reputation/how-to/index.md)
- [XblReputationFeedbackItem](/zh-TW/reference/live/xsapi-c/social_c/structs/xblreputationfeedbackitem.md)
- [XblSocialSubmitReputationFeedbackAsync](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialsubmitreputationfeedbackasync.md)
- [XblSocialSubmitBatchReputationFeedbackAsync](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialsubmitbatchreputationfeedbackasync.md)
