ExzileGames.AndroidPlayGamesBridge 1.0.18

There is a newer version of this package available.
See the version list below for details.
dotnet add package ExzileGames.AndroidPlayGamesBridge --version 1.0.18
                    
NuGet\Install-Package ExzileGames.AndroidPlayGamesBridge -Version 1.0.18
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ExzileGames.AndroidPlayGamesBridge" Version="1.0.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExzileGames.AndroidPlayGamesBridge" Version="1.0.18" />
                    
Directory.Packages.props
<PackageReference Include="ExzileGames.AndroidPlayGamesBridge" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ExzileGames.AndroidPlayGamesBridge --version 1.0.18
                    
#r "nuget: ExzileGames.AndroidPlayGamesBridge, 1.0.18"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ExzileGames.AndroidPlayGamesBridge@1.0.18
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ExzileGames.AndroidPlayGamesBridge&version=1.0.18
                    
Install as a Cake Addin
#tool nuget:?package=ExzileGames.AndroidPlayGamesBridge&version=1.0.18
                    
Install as a Cake Tool

AndroidPlayGamesBridge

A Java bridge + C# interop library that exposes Google Play Games Services v2 APIs missing from the Xamarin.GooglePlayServices.Games.V2 NuGet bindings for .NET Android.

Problem

The Xamarin.GooglePlayServices.Games.V2 NuGet package (all versions) is missing several key PGS v2 APIs:

These APIs exist in the Java AAR but the .NET binding generator excluded them. Creating linker descriptors does not help — the managed types were never generated.

Solution

This library provides a Java bridge class compiled directly into your Android project. The Java class calls the native PGS v2 APIs, and C# code communicates with it via auto-generated JNI bindings. No custom binding library or AAR manipulation needed.

APIs Exposed

API Methods Status in NuGet
Sign-In SignInAsync, IsAuthenticated Partially available
Players GetCurrentPlayerAsync (ID, display name, avatar URIs) Missing
Snapshots LoadSnapshotAsync, SaveSnapshotAsync, DeleteSnapshotAsync Missing
Leaderboards SubmitScoreAsync, ShowLeaderboard, ShowAllLeaderboards Missing
Achievements UnlockAsync, IncrementAsync, RevealAsync, ShowAchievements Missing
Events IncrementEvent, LoadEventsAsync Missing
Player Stats GetPlayerStatsAsync (session length, churn, spend) Missing

Setup

1. Add project reference

<ProjectReference Include="..\AndroidPlayGamesBridge\AndroidPlayGamesBridge.csproj" />

2. Ensure Play Games NuGet is referenced

The bridge project already includes Xamarin.GooglePlayServices.Games.V2. Your Android project needs the same package for Play Games initialization.

3. Initialize in your Activity

using AndroidPlayGamesBridge.Interop;

protected override void OnCreate(Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);

    var bridge = new AndroidPlayGamesBridgeImpl(this);
    PlayGamesBridgeManager.SetImplementation(bridge);
}

4. Use from shared code

using AndroidPlayGamesBridge.Interop;

// Sign in
var signIn = await PlayGamesBridgeManager.SignInAsync(silent: true);

// Get player info (no more auth code exchange workaround!)
var player = await PlayGamesBridgeManager.GetCurrentPlayerAsync();
if (player.Success)
    Console.WriteLine($"Hello {player.DisplayName} ({player.PlayerId})");

// Cloud save
await PlayGamesBridgeManager.SaveSnapshotAsync("save_slot_1", jsonData, "Auto-save");
var load = await PlayGamesBridgeManager.LoadSnapshotAsync("save_slot_1");
if (load.Success)
    Console.WriteLine(load.Data);

// Leaderboards
await PlayGamesBridgeManager.SubmitScoreAsync("leaderboard_id", 9001);
PlayGamesBridgeManager.ShowAllLeaderboards();

// Achievements
await PlayGamesBridgeManager.UnlockAchievementAsync("achievement_id");
PlayGamesBridgeManager.ShowAchievements();

Architecture

Your Android Project (.csproj)
  └── references AndroidPlayGamesBridge project
        ├── Java/PlayGamesBridge.java     ← compiled by Android build, calls PGS v2 Java APIs
        ├── Interop/IPlayGamesBridge.cs   ← shared interface (works on all platforms)
        ├── Interop/PlayGamesBridgeManager.cs  ← static access point
        └── Interop/AndroidPlayGamesBridgeImpl.cs  ← C# wrapper calling Java via JNI

The Java source is compiled directly by the Android build system. The .NET Android binding generator automatically creates C# types for the Java class and its listener interfaces. No manual AAR binding or metadata transforms needed.

Requirements

  • .NET 9+ / .NET 10+
  • Xamarin.GooglePlayServices.Games.V2 NuGet package
  • Android API 23+
  • Google Play Games Services enabled in Google Play Console

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.25 107 4/9/2026
1.0.24 104 4/9/2026
1.0.19 93 4/9/2026
1.0.18 100 4/9/2026
1.0.17 97 4/9/2026
1.0.12 103 4/9/2026
1.0.11 101 4/8/2026
1.0.10 122 3/29/2026
1.0.0 110 3/27/2026