![]() |
VOOZH | about |
dotnet add package Kebechet.Maui.RevenueCat.InAppBilling --version 7.1.0
NuGet\Install-Package Kebechet.Maui.RevenueCat.InAppBilling -Version 7.1.0
<PackageReference Include="Kebechet.Maui.RevenueCat.InAppBilling" Version="7.1.0" />
<PackageVersion Include="Kebechet.Maui.RevenueCat.InAppBilling" Version="7.1.0" />Directory.Packages.props
<PackageReference Include="Kebechet.Maui.RevenueCat.InAppBilling" />Project file
paket add Kebechet.Maui.RevenueCat.InAppBilling --version 7.1.0
#r "nuget: Kebechet.Maui.RevenueCat.InAppBilling, 7.1.0"
#:package Kebechet.Maui.RevenueCat.InAppBilling@7.1.0
#addin nuget:?package=Kebechet.Maui.RevenueCat.InAppBilling&version=7.1.0Install as a Cake Addin
#tool nuget:?package=Kebechet.Maui.RevenueCat.InAppBilling&version=7.1.0Install as a Cake Tool
👁 NuGet Version
👁 NuGet Downloads
👁 Last updated (main)
👁 Twitter
A .NET MAUI wrapper library for RevenueCat in-app purchases. Provides a unified C# API that abstracts away the need for you to use platform-specific code from Android and iOS native bindings.
dotnet add package Kebechet.Maui.RevenueCat.InAppBilling
In your MauiProgram.cs:
builder.Services.AddRevenueCatBilling();
In App.xaml.cs, inject IRevenueCatBilling and initialize in OnStart():
public partial class App : Application
{
private readonly IRevenueCatBilling _revenueCat;
public App(IRevenueCatBilling revenueCat)
{
InitializeComponent();
_revenueCat = revenueCat;
}
protected override void OnStart()
{
var revenueCatApiKey = string.Empty;
#if __ANDROID__
revenueCatApiKey = "<your-android-api-key>";
#elif __IOS__
revenueCatApiKey = "<your-ios-api-key>";
#endif
_revenueCat.Initialize(revenueCatApiKey);
base.OnStart();
}
}
Important: Initialize must be called in
OnStart(), not in the constructor.
| Method | Description |
|---|---|
Initialize(string apiKey) |
Initialize RevenueCat with your platform-specific API key |
IsInitialized() |
Check if the SDK has been initialized |
IsAnonymous() |
Check if current user is anonymous |
GetAppUserId() |
Get the current user ID |
| Method | Description |
|---|---|
GetOfferings(bool forceRefresh = false) |
Fetch available offerings and packages |
CheckTrialOrIntroDiscountEligibility(List<string> identifiers) |
Check eligibility for trials/intro pricing |
| Method | Description |
|---|---|
PurchaseProduct(PackageDto package) |
Initiate a purchase flow |
GetActiveSubscriptions() |
Get list of active subscription identifiers |
GetAllPurchasedIdentifiers() |
Get all purchased product identifiers |
GetPurchaseDateForProductIdentifier(string productSku) |
Get purchase date for a specific product |
RestoreTransactions() |
Restore previous purchases |
| Method | Description |
|---|---|
Login(string appUserId) |
Log in an identified user |
Logout() |
Log out and create anonymous user |
GetCustomerInfo() |
Get current customer info and entitlements |
GetManagementSubscriptionUrl() |
Get URL for subscription management |
| Method | Description |
|---|---|
SetEmail(string email) |
Set user's email |
SetDisplayName(string name) |
Set user's display name |
SetPhoneNumber(string phone) |
Set user's phone number |
SetAttributes(IDictionary<string, string> attributes) |
Set custom attributes |
public class PurchaseService
{
private readonly IRevenueCatBilling _revenueCat;
public PurchaseService(IRevenueCatBilling revenueCat)
{
_revenueCat = revenueCat;
}
public async Task<bool> PurchaseSubscription()
{
var offerings = await _revenueCat.GetOfferings();
if (offerings.Count == 0)
return false;
var defaultOffering = offerings.FirstOrDefault(o => o.IsCurrent);
var monthlyPackage = defaultOffering?.AvailablePackages
.FirstOrDefault(p => p.Identifier == "monthly");
if (monthlyPackage == null)
return false;
var result = await _revenueCat.PurchaseProduct(monthlyPackage);
if (result.IsSuccess)
{
// Purchase successful
return true;
}
if (result.ErrorStatus == PurchaseErrorStatus.PurchaseCancelledError)
{
// User cancelled - not an error
return false;
}
// Handle other errors
Console.WriteLine($"Purchase failed: {result.ErrorStatus}");
return false;
}
public async Task<bool> HasActiveSubscription(string entitlementId)
{
var customerInfo = await _revenueCat.GetCustomerInfo();
return customerInfo?.ActiveSubscriptions
.Any(e => e == entitlementId) ?? false;
}
}
| Platform | Support |
|---|---|
| Android | Full implementation |
| iOS | Full implementation |
| Windows | Stub (returns defaults) |
| MacCatalyst | Stub (returns defaults) |
Stub implementations return:
true for boolean methodsstring.Empty for string methodsnull for nullable typesThis allows you to build and test on Windows/Mac without platform conditionals.
The library follows a non-throwing approach for runtime errors:
Initialize())ErrorStatus in result DTOs (e.g., PurchaseResultDto.ErrorStatus)null for nullable typesThis design ensures your app never crashes due to store-related issues.
| Error | Description |
|---|---|
PurchaseCancelledError |
User cancelled the purchase |
StoreProblemError |
Issue with the app store |
NetworkError |
Network connectivity issue |
ProductAlreadyPurchasedError |
Product was already purchased |
PaymentPendingError |
Payment is pending (e.g., awaiting approval) |
See for the complete list.
Feel free to create an issue or pull request. For major changes, please open an issue first to discuss your proposal - large PRs without prior discussion may be rejected.
This project is licensed under the .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-android35.0 net9.0-android35.0 is compatible. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-ios18.0 net9.0-ios18.0 is compatible. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net9.0-windows10.0.19041 net9.0-windows10.0.19041 is compatible. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Kebechet.Maui.RevenueCat.InAppBilling:
| Package | Downloads |
|---|---|
|
benxu.AppPlatform.Billing.RevenueCat
RevenueCat integration for in-app subscriptions in .NET MAUI. Provides real SDK integration for Android/iOS with optional simulator mode for testing. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.1.0 | 42 | 6/17/2026 |
| 7.0.1 | 157 | 6/10/2026 |
| 7.0.0 | 340 | 5/19/2026 |
| 6.0.0 | 374 | 5/13/2026 |
| 5.5.0 | 933 | 2/8/2026 |
| 5.4.4 | 930 | 1/10/2026 |
| 5.4.3 | 192 | 1/4/2026 |
| 5.4.2 | 675 | 12/7/2025 |
| 5.4.1 | 509 | 11/3/2025 |
| 5.4.0 | 238 | 11/2/2025 |
| 5.3.2 | 603 | 10/11/2025 |
| 5.3.1 | 199 | 10/11/2025 |
| 5.3.0 | 741 | 8/21/2025 |
| 5.2.1 | 284 | 8/18/2025 |
| 5.2.0 | 272 | 8/11/2025 |
| 5.1.0 | 1,125 | 3/26/2025 |
| 5.0.1 | 318 | 3/2/2025 |
| 5.0.0 | 579 | 2/8/2025 |
| 4.5.4 | 804 | 12/16/2024 |
| 4.5.3 | 1,593 | 10/14/2024 |
ADDED
- New `PeriodType.Prepaid` value and mapping for prepaid subscriptions on Android and iOS. #115