Iaphub 1.1.2
dotnet add package Iaphub --version 1.1.2
NuGet\Install-Package Iaphub -Version 1.1.2
<PackageReference Include="Iaphub" Version="1.1.2" />
<PackageVersion Include="Iaphub" Version="1.1.2" />
<PackageReference Include="Iaphub" />
paket add Iaphub --version 1.1.2
#r "nuget: Iaphub, 1.1.2"
#:package Iaphub@1.1.2
#addin nuget:?package=Iaphub&version=1.1.2
#tool nuget:?package=Iaphub&version=1.1.2
IAPHUB - .NET In-App Purchase SDK
The easiest way to monetize your iOS and Android .NET apps by selling in-app purchases.
Features
- 🚀 Easy Integration - Simple API for managing in-app purchases
- 📱 Cross-Platform - Works with .NET MAUI, Avalonia, and other .NET frameworks
- 🍎 iOS Support - Full StoreKit V1 and V2 integration
- 🤖 Android Support - Full Google Play Billing Library integration
- 💰 Multiple Product Types - Consumables, non-consumables, and subscriptions
- 🔄 Receipt Validation - Server-side receipt validation through IAPHUB
- 📊 Analytics - Built-in analytics and insights
Supported Platforms
- iOS: iOS 13.0+
- Android: API Level 24+
- Frameworks: .NET MAUI, Avalonia, and other .NET 9+ / .NET 10+ frameworks
Installation
Install via NuGet Package Manager:
dotnet add package Iaphub
Or via Package Manager Console:
Install-Package Iaphub
Getting Started
Please refer to our Quickstart Guide for step-by-step instructions on integrating IAPHUB into your .NET app.
You can also learn all about our SDK methods in our comprehensive SDK Reference.
Quick Start
Recommended Pattern: Service Wrapper
For better testability and state management, we recommend wrapping the SDK in a service class:
using System.Collections.ObjectModel;
public interface IStoreService
{
ObservableCollection<IaphubProduct> ProductsForSale { get; }
ObservableCollection<IaphubActiveProduct> ActiveProducts { get; }
Task InitializeAsync();
Task<IaphubReceiptTransaction> BuyAsync(string sku);
Task RestoreAsync();
Task LoginAsync(string userId);
Task LogoutAsync();
}
public class StoreService : IStoreService
{
private readonly SemaphoreSlim _refreshLock = new(1, 1);
public ObservableCollection<IaphubProduct> ProductsForSale { get; } = new();
public ObservableCollection<IaphubActiveProduct> ActiveProducts { get; } = new();
public async Task InitializeAsync()
{
await IaphubSdk.StartAsync(
// Found in IAPHUB dashboard
appId: "your-app-id",
// Found in IAPHUB dashboard
apiKey: "your-api-key",
// Set to true to allow purchases without user login
allowAnonymousPurchase: false,
// Enable StoreKit V2 (recommended, requires App Store Server API configuration)
enableStorekitV2: true
);
IaphubSdk.OnUserUpdate += async (s, e) => await RefreshProductsAsync();
await RefreshProductsAsync();
}
private async Task RefreshProductsAsync()
{
if (!await _refreshLock.WaitAsync(0)) return;
try
{
var products = await IaphubSdk.GetProductsAsync();
ProductsForSale.Clear();
foreach (var product in products.ProductsForSale)
ProductsForSale.Add(product);
ActiveProducts.Clear();
foreach (var product in products.ActiveProducts)
ActiveProducts.Add(product);
}
finally
{
_refreshLock.Release();
}
}
public Task<IaphubReceiptTransaction> BuyAsync(string sku) => IaphubSdk.BuyAsync(sku);
public Task RestoreAsync() => IaphubSdk.RestoreAsync();
public Task LoginAsync(string userId) => IaphubSdk.LoginAsync(userId);
public async Task LogoutAsync()
{
await IaphubSdk.LogoutAsync();
ProductsForSale.Clear();
ActiveProducts.Clear();
}
}
Then register it in your DI container:
// MAUI (MauiProgram.cs)
builder.Services.AddSingleton<IStoreService, StoreService>();
Make sure to call InitializeAsync() when your app starts.
Requirements
- .NET 9.0 or .NET 10.0 or later
- An IAPHUB account (sign up at iaphub.com)
Support
- 📧 Email: support@iaphub.com
- 🐛 Issues: https://github.com/iaphub/dotnet-iaphub/issues
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-android35.0 is compatible. net9.0-browser was computed. net9.0-ios was computed. net9.0-ios18.0 is compatible. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
-
net10.0-android36.0
- GoogleGson (>= 2.11.0)
- Square.OkHttp3 (>= 4.12.0.1)
- Xamarin.Android.Google.BillingClient.Ktx (>= 7.1.1.4)
- Xamarin.AndroidX.Lifecycle.Common (>= 2.8.7.4)
- Xamarin.AndroidX.Lifecycle.Extensions (>= 2.2.0.7)
- Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.7.4)
- Xamarin.Kotlin.StdLib (>= 2.0.21.4)
- Xamarin.KotlinX.Coroutines.Core (>= 1.9.0.4)
-
net10.0-ios26.0
- No dependencies.
-
net9.0
- No dependencies.
-
net9.0-android35.0
- GoogleGson (>= 2.11.0)
- Square.OkHttp3 (>= 4.12.0.1)
- Xamarin.Android.Google.BillingClient.Ktx (>= 7.1.1.4)
- Xamarin.AndroidX.Lifecycle.Common (>= 2.8.7.4)
- Xamarin.AndroidX.Lifecycle.Extensions (>= 2.2.0.7)
- Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.7.4)
- Xamarin.Kotlin.StdLib (>= 2.0.21.4)
- Xamarin.KotlinX.Coroutines.Core (>= 1.9.0.4)
-
net9.0-ios18.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.