Skip to content

lampo/bugsnag-maui

Repository files navigation

Bugsnag.Maui: Bugsnag.Maui package in RamseySolutions feed in Azure Artifacts
Bugsnag.Android: Bugsnag.Android package in RamseySolutions feed in Azure Artifacts
Bugsnag.iOS: Bugsnag.iOS package in RamseySolutions feed in Azure Artifacts

bugsnag-maui

Binding library for the Bugsnag SDK It consists of a android and ios binding and a cross platform sdk to consume the bindings.

Installation

Install the package from nuget

dotnet package add Bugsnag.Maui
dotnet package add Bugsnag.Android
dotnet package add Bugsnag.iOS

or add package reference to your project file

<ItemGroup>
    <PackageReference Include="Bugsnag.Maui" Version="<insert version>" />    
    <PackageReference Include="Bugsnag.Android" Version="<insert version>" />
    <PackageReference Include="Bugsnag.iOS" Version="<insert version>" />
</ItemGroup>
    

the native bindings follow the sdk version that they are bound to

Package Version SDK Version
Bugsnag.Maui Bugsnag.Maui package in RamseySolutions feed in Azure Artifacts N/A
Bugsnag.Android Bugsnag.Android package in RamseySolutions feed in Azure Artifacts 6.17.0
Bugsnag.iOS Bugsnag.iOS package in RamseySolutions feed in Azure Artifacts 6.32.2

Usage

using Bugsnag.Maui;

public static class MauiProgram
{
  public static MauiApp CreateMauiApp(Action<IServiceCollection>? addServices = null)
  {
    var builder = MauiApp.CreateBuilder();
    builder.UseBugsnag(configure =>
            configure
              .WithApiKey(BugsnagApiKey)
              .WithReleaseStage(ReleaseStage.Local)
              .OnSendTransform(BugsnagErrorGrouping.Default)
            );
    
    ...
  }
}

Building

Android

prereques your android environment must be configured. see dotnet maui getting started you also must have ANDROID_HOME configured

iOS

  • open project
  • build

Note: the rake file does not correctly handle creating the .xcodeproj, in fact, all of the files that are supposed to be automatically copied are committed to the repo. There is going to be a little bit of manual work to bump the ios sdk to a new version. The other option is to finish building the scripts.

Capturing Mono androdi native crash output for Bugsnag

We use AndroidRedirectStdToFile to capture Mono's Managed Stacktrace from native crashes.

// In MainActivity or early startup
AndroidRedirectStdToFile.Start("Bugsnag.Maui");

On the next app launch after a crash, look in <files>/crashes/ for the latest crash_<epochMs>.txt and attach it to the Bugsnag report.

About

Bugsnag bindings for dotnet maui

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •