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

# PFAuthenticationLoginWithGooglePlayGamesServicesAsync

> Google Play Games アカウントの資格情報を使用してユーザーをサインインさせます。

Google Play Games アカウントの資格情報を使用してユーザーをサインインさせます。

## 構文

```cpp theme={null}
HRESULT PFAuthenticationLoginWithGooglePlayGamesServicesAsync(  
    PFServiceConfigHandle serviceConfigHandle,  
    const PFAuthenticationLoginWithGooglePlayGamesServicesRequest* request,  
    XAsyncBlock* async  
)  
```

### パラメーター

**`serviceConfigHandle`**   PFServiceConfigHandle

PFServiceConfigCreateHandle 呼び出しから返される PFServiceConfigHandle。

**`request`**   [PFAuthenticationLoginWithGooglePlayGamesServicesRequest\*](/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleplaygamesservicesrequest)

値が設定されたリクエスト オブジェクト。

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

非同期操作用の XAsyncBlock。

### 戻り値

型: HRESULT

この API 操作の結果コード。

## 解説

この API は Android で利用できます。Google Play Games サインインは、デバイス上の Google Play Games sign-in for Android API を使用して Google OAuth 2.0 資格情報を取得し、この API に渡すことで行われます。ユーザーが初めて Google Play Games アカウントでサインインし、CreateAccount が true に設定されている場合、新しい PlayFab アカウントが作成され、その Google Play Games アカウントにリンクされます。Google Play Games アカウントにリンクされた PlayFab アカウントがない場合はそれを示すエラーが返されるため、タイトルはユーザーを PlayFab アカウントの作成に誘導できます。Android アプリケーションで Google Play Games アカウント資格情報を取得する現在の (推奨される) 方法は、GamesSignInClient.requestServerSideAccess() を呼び出し、取得した認証コードをこの API の ServerAuthCode パラメーターとして送信することです。これを行う前に、Google API Console で OAuth 2.0 Web アプリケーションのクライアント ID を作成し、そのクライアント ID とシークレットをタイトルの PlayFab Game Manager Google アドオンに構成する必要があります。この方法はユーザーに追加の Google アカウント権限を要求する必要がないため、可能な限り摩擦の少ないユーザー エクスペリエンスを実現します。サーバー認証コードの取得の詳細については、[https://developers.google.com/games/services/android/signin](https://developers.google.com/games/services/android/signin) を参照してください。非同期タスクが完了したら、[PFAuthenticationLoginWithGooglePlayGamesServicesGetResult](/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleplaygamesservicesgetresult) を呼び出して結果を取得します。

## 要件

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

## 関連項目

[PFAuthentication のメンバー](/services/playfab/api-references/c/pfauthentication/pfauthentication_members)


## Related topics

- [PFAuthenticationLoginWithGooglePlayGamesServicesGetResult](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleplaygamesservicesgetresult.md)
- [PFAuthenticationLoginWithGooglePlayGamesServicesGetResultSize](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithgoogleplaygamesservicesgetresultsize.md)
- [Services C API overview - PFAuthentication.h](/ja-jp/services/playfab/api-references/c/pfauthentication/pfauthentication_members.md)
- [PFAuthenticationReLoginWithGooglePlayGamesServicesAsync](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithgoogleplaygamesservicesasync.md)
- [PFAuthenticationLoginWithGooglePlayGamesServicesRequest](/ja-jp/services/playfab/api-references/c/pfauthenticationtypes/structs/pfauthenticationloginwithgoogleplaygamesservicesrequest.md)
