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

# PFAccountManagementClientLinkGoogleAccountAsync

> 使用 Google 帳戶認證，將目前登入的使用者帳戶連結至其 Google 帳戶

使用 Google 帳戶認證，將目前登入的使用者帳戶連結至其 Google 帳戶

## 語法

```cpp theme={null}
HRESULT PFAccountManagementClientLinkGoogleAccountAsync(  
    PFEntityHandle entityHandle,  
    const PFAccountManagementLinkGoogleAccountRequest* request,  
    XAsyncBlock* async  
)  
```

### 參數

**`entityHandle`**   PFEntityHandle

用於驗證的 PFEntityHandle。

**`request`**   [PFAccountManagementLinkGoogleAccountRequest\*](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementlinkgoogleaccountrequest)

已填入的要求物件。

**`async`**   XAsyncBlock\*<br />*Inout*

用於非同步作業的 XAsyncBlock。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。

## 備註

此 API 可在 Linux、Android 和 macOS 上使用。Google 登入是透過在裝置上使用 Google sign-in for Android API 取得 Google OAuth 2.0 認證，並將其傳遞給此 API 來完成。另請參閱 ClientLoginWithGoogleAccountAsync、ClientUnlinkGoogleAccountAsync。呼叫 XAsyncGetStatus 以取得作業的狀態。如果服務呼叫失敗，非同步結果將為 E\_PF\_ACCOUNT\_ALREADY\_LINKED、E\_PF\_ACCOUNT\_LINKED\_TO\_A\_BANNED\_PLAYER、E\_PF\_GOOGLE\_O\_AUTH\_ERROR、E\_PF\_GOOGLE\_O\_AUTH\_NO\_ID\_TOKEN\_INCLUDED\_IN\_RESPONSE、E\_PF\_GOOGLE\_O\_AUTH\_NOT\_CONFIGURED\_FOR\_TITLE、E\_PF\_INVALID\_GOOGLE\_TOKEN、E\_PF\_LINKED\_ACCOUNT\_ALREADY\_CLAIMED 或任何全域 PlayFab 服務錯誤。如需錯誤處理的詳細資訊，請參閱文件頁面「Handling PlayFab Errors」。

## 需求

**標頭：** PFAccountManagement.h

## 另請參閱

[PFAccountManagement 成員](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

- [服務 C API 概觀 - PFAccountManagement.h](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)
- [PFAccountManagementClientLinkGooglePlayGamesServicesAccountAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinkgoogleplaygamesservicesaccountasync.md)
- [PFAccountManagementClientUnlinkGoogleAccountAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinkgoogleaccountasync.md)
- [PFAccountManagementClientUnlinkGooglePlayGamesServicesAccountAsync](/zh-TW/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinkgoogleplaygamesservicesaccountasync.md)
- [PFAccountManagementLinkGoogleAccountRequest](/zh-TW/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementlinkgoogleaccountrequest.md)
