SyntaxCircus.RevenueCat.Maui 0.1.2

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

SyntaxCircus.RevenueCat.Maui

Build NuGet License: MIT

Client-side RevenueCat helpers for MAUI apps, built on top of Kebechet.Maui.RevenueCat.InAppBilling (the vendor SDK binding — not reimplemented here). Covers SDK initialization, identity sync on login, offering-to-DTO mapping, and a purchase/restore orchestrator.

For backend-side RevenueCat integration (webhook verification, REST clients), see SyntaxCircus.RevenueCat.

No support guaranteed. Published as-is and maintained on a best-effort basis. Issues and PRs are welcome, but there's no SLA — fork it or vendor what you need if that's not enough.

Targets

net10.0-android and net10.0-ios only, matching the vendor SDK's proven real-world coverage. Add maccatalyst/windows yourself if you've verified Kebechet.Maui.RevenueCat.InAppBilling supports them for your use case.

What this library does

API Purpose
AddRevenueCatMaui(...) Registers the vendor billing service and binds RevenueCatBillingOptions from configuration.
RevenueCatInitializer.TryInitialize(...) Chooses the correct publishable key and initializes the SDK.
RevenueCatIdentitySync.SyncLoginAsync(...) Keeps RevenueCat app_user_id aligned with your app user after login.
RevenueCatOfferingsMapper.GetCurrentProductsAsync(...) Flattens the current RevenueCat offering into simple product DTOs.
RevenueCatPurchaseOrchestrator.PurchaseAsync(...) Resolves a package and starts a purchase flow.
RevenueCatPurchaseOrchestrator.RestoreAsync(...) Restores prior store transactions and re-syncs identity when needed.

Quick start

1. Register the service

// MauiProgram.cs
builder.Services.AddRevenueCatMaui(builder.Configuration); // binds "RevenueCat", registers IRevenueCatBilling
{
  "RevenueCat": {
    "AndroidApiKey": "goog_...",
    "IosApiKey": "appl_..."
  }
}

2. Initialize the SDK early

// App.xaml.cs — initialize once, early in the app lifecycle
protected override void OnStart()
{
    RevenueCatInitializer.TryInitialize(_billing, _options.Value);
    base.OnStart();
}

For test hosts or other non-mobile entry points, you can also choose the platform explicitly:

RevenueCatInitializer.TryInitialize(_billing, _options.Value, RevenueCatPlatform.Android);

Or supply your own key resolver:

RevenueCatInitializer.TryInitialize(_billing, _options.Value, options => options.IosApiKey);

These are the public (publishable) per-platform keys from the RevenueCat dashboard — safe to ship inside the app binary, distinct from the server-side secret key SyntaxCircus.RevenueCat uses.

Common flows

Identity sync

Point RevenueCat's app_user_id at your own user id as soon as you know it (e.g. after login), so purchases and the TRANSFER webhook event correctly re-associate across reinstalls and new devices:

await RevenueCatIdentitySync.SyncLoginAsync(billing, userId, logger, ct);

Failures are logged and swallowed — this is best-effort, not something worth failing app startup over.

Products

IReadOnlyList<RevenueCatProduct> products =
    await RevenueCatOfferingsMapper.GetCurrentProductsAsync(billing, ct: ct);

Purchases and restore

RevenueCatPurchaseResult result =
    await RevenueCatPurchaseOrchestrator.PurchaseAsync(billing, productIdentifier, logger, ct);

if (result.Success)
{
    // record result.TransactionId / result.AppUserId against your own backend here
}
else if (result.WasCancelled)
{
    // user-initiated cancellation, not an error
}

If you need custom package selection logic, use the resolver overload of PurchaseAsync(...).

RevenueCatPurchaseResult customResult =
    await RevenueCatPurchaseOrchestrator.PurchaseAsync(
        billing,
        productIdentifier,
        logger,
        (packages, id) => packages.FirstOrDefault(p => p.Identifier == id || p.Product.Sku == id),
        ct);
RevenueCatPurchaseResult restoreResult =
    await RevenueCatPurchaseOrchestrator.RestoreAsync(billing, userId, logger, ct);

PurchaseAsync and RestoreAsync only own the store interaction — recording a successful purchase against your own backend (subscriber verification, entitlement grants, etc.) is deliberately left to the caller, the same split SyntaxCircus.RevenueCat's webhook reader uses on the backend side.

Behavior notes

  • PurchaseAsync returns WasCancelled = true for a user-cancelled store flow instead of throwing.
  • RestoreAsync logs and returns a failure result for non-cancellation errors.
  • The default TryInitialize(billing, options) method keeps the existing compile-time Android/iOS behavior.
  • The explicit RevenueCatPlatform and resolver overloads are the non-breaking escape hatches for tests and custom hosts.

Contributing

Issues and pull requests are welcome:

  • Keep changes focused, with a clear description of the behavior change.
  • Match the existing code style (see .editorconfig).
  • Call out any breaking changes to the public API in your PR description.

License

MIT — see LICENSE.txt.

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-ios26.0 is compatible.  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
0.1.4 82 9/6/2026
0.1.3 126 8/17/2026
0.1.2 107 8/16/2026
0.1.1 108 8/16/2026