Skip to content

AppAmbit: Getting Started with MAUI

This guide walks you through setting up the AppAmbit MAUI SDK in your application, focusing on AppAmbit Analytics and Crash Reporting.

Maui open source SDK - The full source code, contribution guidelines, apps for testing, and additional technical documentation are available in our public GitHub repository.

1. Prerequisites

Before getting started, ensure you meet the following requirements:

  • The target devices run iOS 11.0 or higher, or Android 5.0 (API level 21) or higher.

Supported Platforms

  • MAUI for iOS
  • MAUI for Android
  • MAUI for Windows
  • MAUI for macOS
Note: Xamarin is currently not supported by the AppAmbit library.

2. Creating Your App in the AppAmbit Portal

  1. Visit AppAmbit.com.
  2. Sign in or create an account. Navigate to "Apps" and click on "New App".
  3. Provide a name for your app.
  4. Select the appropriate release type and target OS.
  5. Click "Create" to generate your app.
  6. Retrieve the App Key from the app details page.
  7. Use this App Key as a parameter when calling .UseAppAmbit("<YOUR-APPKEY>") in your project.

Adding the AppAmbit SDK to Your Solution

Get the SDK on NUGET (recommended) — easiest to keep up-to-date

Releases — direct download from our GitHub

Add the package to your MAUI project:

dotnet add package com.AppAmbit.Maui
# or specify version
dotnet add package com.AppAmbit.Maui --version 1.1.0

Or, using Visual Studio:

  • Right-click your project → Manage NuGet Packages…
  • Search for AppAmbit and install the latest stable version.

Initializing the SDK

To begin using AppAmbit, you need to explicitly enable the services you wish to use. No services are activated by default.

Import the Namespace

Add the required using directive to your file:

using AppAmbitMaui;

Using .UseAppAmbit()

Call .UseAppAmbit("<YOUR-APPKEY>") during application initialization:

.UseAppAmbit("<YOUR-APPKEY>");

Here's an example of how to configure it within your MauiProgram class:

using AppAmbitMaui;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .UseAppAmbit("<YOUR-APPKEY>");

        return builder.Build();
    }
}

Android

using AppAmbitMaui;

protected override void OnCreate(Bundle? savedInstanceState)
{
    base.OnCreate(savedInstanceState);

    AppAmbitSdk.Start("<YOUR-APPKEY>");

    ...
}

iOS and MacOS

using AppAmbitMaui;

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
    AppAmbitSdk.Start("<YOUR-APPKEY>");
    ...
}

Windows

using AppAmbitMaui;

protected override void OnStartup(StartupEventArgs e)
{
    base.OnStartup(e);
    AppAmbitSdk.Start("<YOUR-APPKEY>");
}


This code automatically generates a session, the session management is automatic.

Android Requirements

Add the following permissions in your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

iOS and macOS requirements

For iOS, add the required URL exceptions in your Info.plist file:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>appambit.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>