Installation

Bugsee .NET SDK is currently supported on pure iOS, Android or MAUI. It supports .NET 6 and up. The recommended way to install Bugsee is using NuGet.

NuGet installation

Open your solution, select "Dependencies" within the project you want to add Bugsee package to and open its context menu. Click "Manage NuGet packages...".

Open NuGet

Type "Bugsee" into search field, select Bugsee package and click "Add Package" button at the bottom right.

Add NuGet package

Initialization

iOS/iPadOS: Make sure you launch your app with Bugsee on a real device. Underlying Bugsee iOS SDK does not work in simulator as it heavily depends on the hardware.

When possible, Bugsee provides unified API across platforms for accessing Bugsee features. Initialization, on the other hand, has minor differences on iOS and Android platforms.

!iOS

// Your AppDelegate.cs file

namespace YourNameSpace
{
  [Register("AppDelegate")]
  public class AppDelegate : MauiUIApplicationDelegate
  {
    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
      // Launch Bugsee
      BugseePlugin.Bugsee.Launch("<your-app-token>");

      return base.FinishedLaunching(application, launchOptions);
    }
  }
}

!Android

// Your MainApplication.cs file - a subclassed Application

namespace YourNameSpace
{
  [Application]
  public class MainApplication : MauiApplication
  {
    public MainApplication(IntPtr handle, JniHandleOwnership ownership)
      : base(handle, ownership)
    {
    }

    protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

    public override void OnCreate()
    {
      base.OnCreate();

      // Launch Bugsee
      BugseePlugin.Bugsee.Launch("<your-app-token>");
    }
  }
}

If you need to launch Bugsee outside of the application startup sequence (e.g. later during application run time upon a user gesture), you should use the Launch() method variant which accepts BugseeLaunchContextProviderHandler. This delegate must return the current context of the running application. This is required on Android, where that delegate must return current activity.

namespace YourNameSpace
{
  public partial class MainPage : ContentPage
  {
    public MainPage()
    {
      InitializeComponent();
    }

    private void OnButtonClicked(object sender, EventArgs e)
    {
      var options = new AndroidLaunchOptions();
      // Set any desired options
      options.monitorNetwork = true;

      // Platform below is from Microsoft.Maui.ApplicationModel namespace
      Bugsee.Launch(() => Platform.CurrentActivity, "<your-application-token>", options);
    }
  }
}