---
title: "Set up Google Play login"
description: "Configure your Google project and authenticate players in test and release builds."
seo:
  noindex: true
---

{/* Copyright (c) 2026 Betide Studio. All Rights Reserved. */}

Use **Google Play Games** for achievements, leaderboards, and snapshots. Use **Request Google ID Token** for a Google identity token accepted by EOS Connect or your backend.

## Set up Android

1. Configure Play Games Services for your app in Play Console. Link an Android OAuth credential with the packaged app's **package name and signing-certificate SHA-1**. Play App Signing builds use the app-signing certificate, which can differ from your upload key.
2. Add your test accounts to Play Games Services testers while the service configuration is unpublished. See [Google's setup guide](https://developer.android.com/games/pgs/console/setup).
3. Set **Web Client ID** in **Project Settings → Betide → Crossplay** if you need ID tokens. This is a **Web application** OAuth client ID, separate from the Android credential.
4. Set **Play Games App Id** under **Betide → Tools** to the numeric games-services project ID. Repackage after changing it; the value is written into Android resources during packaging.

Test on an Android device with the matching signed build and test account.

## Sign in to Play Games

**Blueprint**

<Accordion>
  <AccordionItem title="Sign in to Play Games">
<BlueprintViewer title="Sign in to Play Games" src="/blueprints/crossplay-google-play-login.txt" />
  </AccordionItem>
  <AccordionItem title="Check Play Games authentication">
<BlueprintViewer title="Check Play Games authentication" src="/blueprints/crossplay-google-check-login.txt" />
  </AccordionItem>
</Accordion>

**C++**

Game module dependencies: `PlayGamesServices`, `BetideCore`, `Engine`.

```cpp
#include "Engine/GameInstance.h"
#include "Nodes/SignIn/GPIK_SignIn_AsyncFunction.h"

DEFINE_LOG_CATEGORY_STATIC(LogGameGoogleLogin, Log, All);

void SignInPlayGames(UGameInstance &GameInstance, bool bPrompt = true)
{
    auto *Login = bPrompt ? UGPIK_SignIn_AsyncFunction::SignIn(&GameInstance)
                          : UGPIK_SignIn_AsyncFunction::IsAuthenticated(&GameInstance);
    if (!Login)
        return;
    const TWeakObjectPtr<UGameInstance> WeakGameInstance(&GameInstance);
    Login->OnSuccessCallback = [WeakGameInstance](const FGPIK_PlayerInfo &Player) {
        if (WeakGameInstance.IsValid())
            UE_LOG(LogGameGoogleLogin, Log, TEXT("Signed in: %s"), *Player.DisplayName);
    };
    Login->OnFailureCallback = [WeakGameInstance](const FGPIK_PlayerInfo &) {
        if (WeakGameInstance.IsValid())
            UE_LOG(LogGameGoogleLogin, Warning, TEXT("Play Games sign-in failed"));
    };
    Login->Activate();
}
```

Sign-in tries automatic authentication before showing UI. The authentication check does not prompt.

## Get a Google ID token

**Blueprint**

<BlueprintViewer title="Google identity token" src="/blueprints/crossplay-google-id-token.txt" />

**C++**

```cpp
#include "Nodes/SignIn/GPIK_GoogleSignIn_AsyncFunction.h"

void RequestGoogleToken(
    UObject *WorldContext, const FString &WebClientId,
    TFunction<void(const FGPIK_GoogleSignInResult &, const FBetideError &)> Completion)
{
    auto *Login = UGPIK_GoogleSignIn::RequestGoogleIdToken(WorldContext, WebClientId);
    if (!Login)
        return;
    Login->CompletionCallback = MoveTemp(Completion);
    Login->Activate();
}
```

The completion receives `IdToken`. Use a weak UObject capture if it updates game objects.

Pass the ID token explicitly to external-auth login, or use [Login With Crossplay](/crossplay/identity) to compose provider sign-in. **Request Server Side Access** returns an authorization code for exchange on your backend; it is not an ID token. Never log either credential.

<Accordion>
  <AccordionItem title="Account changes and failed sign-in">

**Sign Out from Google** and **Revoke Google Access** affect Google Sign-In authorization. In C++, use `UGPIK_GoogleSignInLibrary::SignOutFromGoogle()` or `RevokeGoogleAccess()` from the token header. These do not replace your game's crossplay logout.

For configuration failures, compare the installed build's package name and signing certificate with the linked credential, then check the tester account and published service configuration. Signing into Google Play on the device alone does not authorize an unpublished game.

  </AccordionItem>
</Accordion>

Next: [Google Play services](/integrations/google/game-services).
