> ## 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\*](/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementlinkgoogleaccountrequest)

已填充的请求对象。

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

用于异步操作的 XAsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的结果代码。

## 备注

此 API 适用于 Win32、Linux、Android 和 macOS。 Google 登录通过在设备上使用适用于 Android 的 Google 登录 API 获取 Google OAuth 2.0 凭据，并将其传递给此 API 来实现。 另请参阅 ClientLoginWithGoogleAccountAsync, ClientUnlinkGoogleAccountAsync。调用 XAsyncGetStatus 以获取操作的状态。 如果服务调用不成功，异步结果将是 E\_PF\_ACCOUNT\_ALREADY\_LINKED, 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 成员](/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

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