Omnicasa.Maui.PostHog 2026.8.10.7

dotnet add package Omnicasa.Maui.PostHog --version 2026.8.10.7
                    
NuGet\Install-Package Omnicasa.Maui.PostHog -Version 2026.8.10.7
                    
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="Omnicasa.Maui.PostHog" Version="2026.8.10.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Omnicasa.Maui.PostHog" Version="2026.8.10.7" />
                    
Directory.Packages.props
<PackageReference Include="Omnicasa.Maui.PostHog" />
                    
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 Omnicasa.Maui.PostHog --version 2026.8.10.7
                    
#r "nuget: Omnicasa.Maui.PostHog, 2026.8.10.7"
                    
#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 Omnicasa.Maui.PostHog@2026.8.10.7
                    
#: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=Omnicasa.Maui.PostHog&version=2026.8.10.7
                    
Install as a Cake Addin
#tool nuget:?package=Omnicasa.Maui.PostHog&version=2026.8.10.7
                    
Install as a Cake Tool

Maui.Posthog

NuGet Downloads Publish NuGet

.NET MAUI bindings for the native PostHog SDKs, with a single cross-platform façade.

Platform Native SDK Version
Android (net10.0-android) com.posthog:posthog-android (+ com.posthog:posthog 6.29.0) 3.58.0
iOS (net10.0-ios) posthog-ios (PostHog.xcframework) 3.69.3

Features: event capture, feature flags, session replay, autocapture / screen views.

Projects

src/
  Maui.Posthog.Android/   Java binding of posthog-android (+ curtains, posthog core)
  Maui.Posthog.iOS/       ObjC binding of PostHog.xcframework (built from source)
  Maui.Posthog/           Shared IPostHog façade + DI (net10.0-ios;net10.0-android)
samples/
  Maui.Posthog.Sample/    Minimal MAUI app wiring AddPostHog

Usage

Register in MauiProgram:

builder.AddPostHog(options =>
{
    options.ApiKey = "phc_your_project_key";
    options.Host = "https://eu.i.posthog.com";   // or https://us.i.posthog.com
    options.CaptureScreenViews = true;
    options.Autocapture = true;                   // iOS UI element interactions
    options.SessionReplay = true;
    options.Replay.MaskAllTextInputs = true;
});

Then inject IPostHog anywhere:

public class HomeViewModel(IPostHog posthog)
{
    public void OnPurchase() =>
        posthog.Capture("purchase", new Dictionary<string, object>
        {
            ["plan"] = "pro",
            ["amount"] = 49.0,
        });
}

IPostHog surface: Capture, Identify, Screen, Alias, Group, IsFeatureEnabled, GetFeatureFlag, GetFeatureFlagPayload, ReloadFeatureFlags, Register/Unregister, DistinctId, Reset, Flush, OptIn/OptOut, StartSessionReplay/StopSessionReplay.

Overriding behavior

PostHogService is public on each platform and every member is virtual. Subclass it (under Platforms/iOS or Platforms/Android), override what you need, call base to keep the native behavior, and register your type:

public class MyPostHog : PostHogService
{
    public MyPostHog(PostHogOptions options) : base(options) { }

    public override void Capture(string eventName, IDictionary<string, object>? properties = null)
    {
        properties ??= new Dictionary<string, object>();
        properties["app_build"] = AppInfo.BuildString;
        base.Capture(eventName, properties);   // Client is available via the protected property
    }
}

// register the subclass:
builder.AddPostHog<MyPostHog>(o => o.ApiKey = "phc_your_project_key");

Rebuilding the iOS xcframework

PostHog.xcframework under src/Maui.Posthog.iOS/ is prebuilt from posthog-ios 3.69.3. To regenerate against a newer tag, clone the source into scripts/posthog-ios (git clone --depth 1 --branch <tag> https://github.com/PostHog/posthog-ios.git scripts/posthog-ios) and run scripts/build-xcframework.sh; it archives the PostHog scheme for device + simulator with BUILD_LIBRARY_FOR_DISTRIBUTION=YES, runs xcodebuild -create-xcframework, and strips the vendored scripts Apple rejects in embedded frameworks. Copy the result over src/Maui.Posthog.iOS/PostHog.xcframework, then diff the regenerated Headers/PostHog-Swift.h against the previous one and update the binding surface in src/Maui.Posthog.iOS/ApiDefinition.cs.

Notes

  • iOS binds the @objc surface of the Swift SDK. PostHogSDK keeps its mangled Swift runtime name (_TtC7PostHog10PostHogSDK); PostHogConfig / PostHogSessionReplayConfig use clean names.
  • Android reaches the Kotlin PostHogAndroid companion via a small JNI shim (Additions/PostHogAndroid.cs) because the generator does not surface generic companion methods.
  • Android apps need SupportedOSPlatformVersion 24 or higher: this binding targets 24, and posthog-android's own manifest requires at least 23, so a lower minSdk fails the manifest merge.
  • Transforms/Metadata.xml widens PostHogStateless.getConfig() to public (C# can't narrow access on an override) and drops the two com.posthog.internal Gson deserializers, whose generic JsonDeserializer<T> can't satisfy IJsonDeserializer.Deserialize.
Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible.  net10.0-ios26.0 is compatible. 
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
2026.8.10.7 227 8/10/2026
2026.7.20.6 157 7/20/2026
2026.7.20.5 106 7/20/2026
2026.7.17.4 119 7/17/2026
2026.7.17.3 113 7/17/2026
2026.7.17.2 114 7/17/2026
2026.7.17.1 113 7/17/2026
1.0.0 123 7/16/2026