.NET and MAUI

Add Fload's attribution package to an app on .NET for iOS and .NET for Android, with or without MAUI. It calls Fload's native SDKs underneath, so it behaves exactly like them.


What you need

  • .NET 9 or .NET 10, targeting iOS 15 or later and Android 7.0 (API 24) or later.
  • Your app's write key.

1. Add the package

bash
dotnet add package Fload.Attribution --version 1.0.1

It targets net9.0-ios, net10.0-ios, net9.0-android and net10.0-android. It also has plain net9.0 and net10.0 builds where every call does nothing, so a MAUI app with Windows or Mac Catalyst targets still builds. The iOS privacy manifest ships inside the package.


2. Start it at app start

Call FloadAttribution.Configure once, as your app starts.

.NET for iOS. In AppDelegate.FinishedLaunching:

csharp
using Fload.Attribution;

[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
        FloadAttribution.Configure("fload_pk_…");
        // ...
        return true;
    }
}

.NET for Android. In your Application class's OnCreate, passing the app as the context:

csharp
using Fload.Attribution;

[Application]
public class PocketBudgetApp : Application
{
    public PocketBudgetApp(IntPtr handle, JniHandleOwnership transfer) : base(handle, transfer) { }

    public override void OnCreate()
    {
        base.OnCreate();
        FloadAttribution.Configure(this, "fload_pk_…");
    }
}

No Application class? Call it in your launcher activity's OnCreate instead.

MAUI. Once in MauiProgram.CreateMauiApp, with no code per platform:

csharp
using Fload.Attribution;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder.UseMauiApp<App>();

        FloadAttribution.Configure("fload_pk_…");

        return builder.Build();
    }
}

Pass your app user id once you have it, and again after each login. If you use RevenueCat, pass its app user id after RevenueCat is configured, so Fload can match installs to revenue.

csharp
FloadAttribution.SetUserId(appUserId);

A null or blank id is ignored, and it's safe to call before Configure.


4. Check it works

Turn on debug logs while you test:

csharp
FloadAttribution.Configure("fload_pk_…", new FloadOptions { LogLevel = FloadLogLevel.Debug });

Run on a real iPhone and a real Android phone, and look for the native logs: the subsystem com.fload.attribution on iOS, and the Logcat tag FloadAttribution on Android. Remove the debug option before you ship.


5. Ship it

Ship a new build to both stores. Fill in the App Store privacy answers and the Play Data safety form from Privacy. They're the same as for the native SDKs.


Xamarin

The package can't run on Xamarin.iOS or Xamarin.Android. Microsoft ended Xamarin in May 2024, and its last SDKs can't build with the Xcode and Android versions the stores now require. The best path is to move to .NET for iOS and Android, then use the package.

If you can't move yet, the package's repository has a C# drop-in that sends installs over the HTTP API from a Xamarin app: Xamarin over HTTP.


Reference

CallWhat it does
FloadAttribution.Configure(key, options?)Starts the SDK. Call once, at app start
FloadAttribution.Configure(context, key, options?)Android only. The same, with the context you pass. Without it, the SDK uses the application context
FloadAttribution.SetUserId(userId)Links your user id to this install
FloadAttribution.InstallReferenceThis install's random reference, for support questions. null until the SDK has loaded
FloadOptions.LogLevelFloadLogLevel.None, Error, Warning (the default), Info or Debug

Source code and changelog: github.com/fload-ai/fload-attribution-dotnet.