MsbSvg.RevenueCat.Maui.Android.PaywallUI 9.2.0.2

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

MsbSvg.RevenueCat.Maui.Android.PaywallUI

NuGet License: MIT

RevenueCat Android Paywall UI bindings for .NET MAUI.

Show RevenueCat's native Paywall UI — including V2 component-based paywalls designed in the RevenueCat Dashboard — on Android in your .NET MAUI app. No official MAUI binding exists for the RevenueCat UI layer; this package fills that gap.


Why this package?

RevenueCat provides purchases-ui for Android, built entirely with Jetpack Compose. Binding 50+ Compose dependencies directly into MAUI is impractical. This package takes a different approach:

Layer What it does
Thin Java bridge AAR Wraps PaywallActivity launch via PaywallContract — no Compose binding needed on the C# side
purchases-ui-9.2.0.aar RevenueCat's official Paywall UI
~50 native AAR/JAR files All required Jetpack Compose, Coil, OkHttp, Material 3 and other transitive dependencies
C# wrapper Clean RevenueCatPaywallUI static API — configure once, show with one line

Prerequisites

Your MAUI project must already have the RevenueCat core SDK configured. Use one of these NuGet packages:

Note: This package provides only the UI layer. The core purchases SDK must come from one of the packages above.


Installation

dotnet add package MsbSvg.RevenueCat.Maui.Android.PaywallUI

That's it — the bundled .targets file automatically injects the native AAR/JAR files into your Android build.


Quick Start

1. Configure RevenueCat SDK (Platforms/Android/MainApplication.cs)

using MsbSvg.RevenueCat.Maui.Android.PaywallUI;

[Application]
public class MainApplication : MauiApplication
{
    public MainApplication(IntPtr handle, JniHandleOwnership ownership)
        : base(handle, ownership) { }

    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

    public override void OnCreate()
    {
        base.OnCreate();
        RevenueCatPaywallUI.Configure(this, "your_google_api_key");
    }
}

2. Show the Paywall

private void OnShowPaywallClicked(object sender, EventArgs e)
{
#if ANDROID
    var activity = Platform.CurrentActivity;
    if (activity != null)
    {
        RevenueCatPaywallUI.ShowPaywall(activity);
    }
#endif
}

3. Show a specific offering

RevenueCatPaywallUI.ShowPaywall(activity, offeringId: "premium_offering");

4. One-shot: configure + show

RevenueCatPaywallUI.ConfigureAndShowPaywall(activity, "your_google_api_key");

API Reference

Method Description
RevenueCatPaywallUI.Configure(context, apiKey) Initialise the RevenueCat SDK. Call once at app start.
RevenueCatPaywallUI.IsConfigured Returns true if the SDK is already configured.
RevenueCatPaywallUI.ShowPaywall(activity) Launch the paywall for the default offering.
RevenueCatPaywallUI.ShowPaywall(activity, offeringId) Launch the paywall for a specific offering.
RevenueCatPaywallUI.ConfigureAndShowPaywall(activity, apiKey) Configure + launch in a single call.

How it works

Your MAUI C# Code
  → RevenueCatPaywallUI.ShowPaywall(activity)
  → JNI → RevenueCatPaywallBridge.java (bundled AAR)
  → PaywallContract.createIntent()
  → PaywallActivity (Jetpack Compose)
  → Native V1 / V2 paywall rendering

Compatibility

Requirement Value
.NET 9.0+ / 10.0+
Android min SDK API 24 (Android 7.0)
RevenueCat SDK purchases:9.2.0 / purchases-ui:9.2.0
Paywall types V1 (template-based) ✅   V2 (component-based) ✅

Troubleshooting

"Displaying default template due to validation errors"

This is typically a RevenueCat Dashboard issue, not a code problem:

AAPT2 APT2144 error (invalid file path '...stamp')

Fixed in v9.2.0.2. This was caused by the .NET Android SDK incorrectly listing .stamp cache files as Android resources in files.cache. The package's .targets file now automatically cleans up these references before AAPT2 compilation runs. Works on both macOS/Linux and Windows.

If you still encounter this on an older version, update to 9.2.0.2 or later.

ClassNotFoundException at runtime

If you see ClassNotFoundException for Compose/AndroidX classes, make sure no build step is stripping this package's AAR files. The Bind="false" attribute in the .targets file should prevent any C# binding generation — the files are included as raw native libraries only.


🐾 A small note

If this package saved you time and you'd like to say thanks — please feed a stray animal 🐶🐱. No donations needed. Just a small act of kindness for a friend on the street.


Author

Musab Sevgi

License

MIT — see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-android36.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

v9.2.0.2: Fix AAPT2 APT2144 build error caused by .stamp files being incorrectly listed as Android resources in files.cache. The .targets file now auto-cleans these references before resource compilation. Supports macOS/Linux and Windows.