跳轉到主要內容
PFAuthenticationLoginWithGooglePlayGamesServicesRequest 資料模型。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 帳戶。否則,如果沒有任何 PlayFab 帳戶連結至 Google Play Games 帳戶,將會傳回指出此情況的錯誤,讓遊戲可以引導使用者建立 PlayFab 帳戶。目前 (建議) 在 Android 應用程式中取得 Google Play Games 帳戶認證的方法,是呼叫 GamesSignInClient.requestServerSideAccess(),並將驗證碼作為此 API 的 ServerAuthCode 參數傳送。在執行此動作之前,您必須在 Google API Console 中建立 OAuth 2.0 Web 應用程式用戶端識別碼,並在您遊戲的 PlayFab Game Manager Google 附加元件中設定其用戶端識別碼和密碼。此方法不需要提示使用者授與額外的 Google 帳戶權限,因此能提供最順暢的使用者體驗。如需取得伺服器驗證碼的詳細資訊,請參閱 https://developers.google.com/games/services/android/signin.

語法

成員

createAccount   bool 如果目前沒有 PlayFab 帳戶連結至此識別碼,則自動建立一個。 customTags   PFStringDictionaryEntry const*
may be nullptr
(選擇性)與要求相關聯的選擇性自訂標籤(例如組建編號、外部追蹤識別碼等)。 customTagsCount   uint32_t customTags 的計數 infoRequestParameters   PFGetPlayerCombinedInfoRequestParams const*
may be nullptr
(選擇性)指定要為使用者傳回哪些資訊的旗標。 playerSecret   const char*
is null-terminated
(選擇性)用來驗證 API 要求簽章的玩家密碼。 serverAuthCode   const char*
is null-terminated
在用戶端上呼叫 requestServerSideAccess() (https://developers.google.com/games/services/android/signin) Google Play Games 用戶端 API 所取得的 OAuth 2.0 伺服器驗證碼。

需求

標頭: PFAuthenticationTypes.h

另請參閱

PFAuthenticationTypes 成員
最後修改於 2026年10月6日