ExzileGames.AndroidBillingBridge 1.0.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package ExzileGames.AndroidBillingBridge --version 1.0.11
                    
NuGet\Install-Package ExzileGames.AndroidBillingBridge -Version 1.0.11
                    
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.AndroidBillingBridge" Version="1.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExzileGames.AndroidBillingBridge" Version="1.0.11" />
                    
Directory.Packages.props
<PackageReference Include="ExzileGames.AndroidBillingBridge" />
                    
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.AndroidBillingBridge --version 1.0.11
                    
#r "nuget: ExzileGames.AndroidBillingBridge, 1.0.11"
                    
#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.AndroidBillingBridge@1.0.11
                    
#: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.AndroidBillingBridge&version=1.0.11
                    
Install as a Cake Addin
#tool nuget:?package=ExzileGames.AndroidBillingBridge&version=1.0.11
                    
Install as a Cake Tool

AndroidBillingBridge

A Java bridge + C# interop library for Google Play Billing Library on .NET Android. Provides direct access to the full Billing API without reflection hacks or incomplete NuGet bindings.

Problem

The Xamarin.Android.Google.BillingClient NuGet bindings have issues with certain API surfaces — missing method overloads, parameter order inconsistencies, and types that require reflection to invoke. This forces developers to write fragile reflection-based code to call basic operations like ConsumeAsync and QueryProductDetailsAsync.

Solution

This library compiles a Java bridge class directly into your Android project. The Java class calls the Billing Library APIs natively, and C# communicates via auto-generated JNI bindings. No reflection needed.

APIs Exposed

API Methods
Connection ConnectAsync, Disconnect, GetConnectionState
Product Details QueryInAppProductsAsync, QuerySubscriptionsAsync
Purchase Flow LaunchPurchaseFlow, LaunchPurchaseFlowWithOffer, SetPurchaseListener
Consume ConsumeAsync (no reflection hacks)
Acknowledge AcknowledgeAsync
Query Purchases QueryInAppPurchasesAsync, QuerySubscriptionPurchasesAsync
Purchase History QueryInAppPurchaseHistoryAsync, QuerySubscriptionPurchaseHistoryAsync
In-App Messages ShowInAppMessages (price changes, subscription status)
Subscriptions Full offer token + pricing phase support

Setup

1. Add project reference

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

2. Initialize in your Activity

using AndroidBillingBridge.Interop;

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

    var billing = new AndroidBillingBridgeImpl(this);
    BillingBridgeManager.SetImplementation(billing);
}

3. Use from shared code

using AndroidBillingBridge.Interop;

// Connect
var conn = await BillingBridgeManager.ConnectAsync();

// Query products (with real prices from Google Play)
var products = await BillingBridgeManager.QueryInAppProductsAsync(
    ["redchest500", "redchest2000"]);

if (products.Success)
{
    foreach (var p in products.Products!)
        Console.WriteLine($"{p.Name}: {p.OneTimePurchaseOfferDetails?.FormattedPrice}");
}

// Set purchase listener
BillingBridgeManager.SetPurchaseListener(result =>
{
    if (result.ResponseCode == 0 && result.Purchases != null)
    {
        foreach (var purchase in result.Purchases)
        {
            // Consume or acknowledge
            _ = BillingBridgeManager.ConsumeAsync(purchase.PurchaseToken);
        }
    }
});

// Launch purchase
BillingBridgeManager.LaunchPurchaseFlow("redchest500");

// Query existing purchases (restore)
var existing = await BillingBridgeManager.QueryInAppPurchasesAsync();

What this replaces

The existing AndroidInAppPurchaseService uses reflection to work around binding issues:

// BEFORE: reflection hacks
var method = billingClient.GetType().GetMethods()
    .Where(m => m.Name == "ConsumeAsync" || m.Name == "Consume")...
method.Invoke(billingClient, args);
// AFTER: direct bridge call
var result = await BillingBridgeManager.ConsumeAsync(purchaseToken);

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 172 4/9/2026
1.0.24 97 4/9/2026
1.0.19 94 4/9/2026
1.0.18 94 4/9/2026
1.0.17 96 4/9/2026
1.0.12 96 4/9/2026
1.0.11 105 4/8/2026
1.0.10 127 3/29/2026
1.0.0 109 3/27/2026