Raygun4Xamarin.Forms 1.0.0-beta

This is a prerelease version of Raygun4Xamarin.Forms.
There is a newer version of this package available.
See the version list below for details.

Requires NuGet 2.8.3 or higher.

dotnet add package Raygun4Xamarin.Forms --version 1.0.0-beta                
NuGet\Install-Package Raygun4Xamarin.Forms -Version 1.0.0-beta                
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="Raygun4Xamarin.Forms" Version="1.0.0-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Raygun4Xamarin.Forms --version 1.0.0-beta                
#r "nuget: Raygun4Xamarin.Forms, 1.0.0-beta"                
#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.
// Install Raygun4Xamarin.Forms as a Cake Addin
#addin nuget:?package=Raygun4Xamarin.Forms&version=1.0.0-beta&prerelease

// Install Raygun4Xamarin.Forms as a Cake Tool
#tool nuget:?package=Raygun4Xamarin.Forms&version=1.0.0-beta&prerelease                

Raygun4Xamarin.Forms provider

Installation

The provider targets .NET Standard 2.0 and is available through NuGet packages, found here.

The currently supported platforms are Android and iOS with the following versions or newer:

  • Xamarin.Android 8.0
  • Xamarin.iOS 10.0

Initialisation

The initialisation of Raygun must occur early in the apps initial startup phase. We recommend doing this in the constructor of your Application class. Using the static Init method will also ensure a shared RaygunClient instance is available through the static Current property on the RaygunClient class.

public partial class App : Application
{
  public App()
  {
    InitializeComponent();

    // Initialising the Raygun client 
    RaygunClient.Init("_API_KEY_");

    // Remaining application setup logic
    MainPage = new MainPage();
  }
}

Each platform being targeted requires an additional configuration step using the RaygunPlatform class in the following places.

For Android:

public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
  protected override void OnCreate(Bundle savedInstanceState)
  {
    // MainActivity startup logic
    base.OnCreate(savedInstanceState);
    global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
    LoadApplication(new App());

    // Configure Raygun for the current platform
    RaygunPlatform.Configure(this);
  }
}

For iOS:

public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
  public override bool FinishedLaunching(UIApplication app, NSDictionary options)
  {
    // AppDelegate startup logic
    global::Xamarin.Forms.Forms.Init();
    LoadApplication(new App());

    // Configure Raygun for the current platform
    RaygunPlatform.Configure();

    return base.FinishedLaunching(app, options);
  }
}

Unique User Tracking

Providing user information will allow Raygun to correlate error reports and RUM events with specific users. Assigning user information is performed by assigning a RaygunUserInfo object to your client instance.

RaygunClient.Current.User = new RaygunUserInfo("_UNIQUE_ID_")
{
  FirstName   = "Ronald",
  FullName    = "Ronald Raygun",
  Email       = "ronald@raygun.com",
  IsAnonymous = false
};

Crash Reporting

Once the client is initialised you can enable it's Crash Reporting functionality.

RaygunClient.Current.EnableCrashReporting();

Once enabled your are able to:

  • Automatically report unhandled exceptions
  • Manually report errors
  • Record breadcrumbs

Before send event handling

RaygunClient.Current.BeforeSendingCrashReportEvent += (sender, e) =>
{
  if (e.Report.Details.Error.ClassName == "NotImplementedException")
  {
   	e.Cancel = true;
  }
};

Manually reporting errors

Exceptions may be manually reported using the client.

try
{
  DoSomethingRisky();
}
catch (Exception exception)
{
  RaygunClient.Current.Send(exception);
}

Recording breadcrumbs

Breadcrumbs can be recorded using the client throughout your application. The current crumbs are then sent with each error report sent.

RaygunClient.Current.RecordBreadcrumb("Entered login screen");

Real User Monitoring

Once the client is initialised you can enable it's Real User Monitoring (RUM) functionality.

RaygunClient.Current.EnableRealUserMonitoring();

Once enabled your are able to:

  • Automatically report user sessions
  • Automatically report view timing events
  • Manually report timing events

Manually report timing events

RUM timing events can be manually reported using the client.

RaygunClient.Current.SendTimingEvent(RaygunRUMEventTimingType.ViewLoaded, "TestView", 123);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed.  monoandroid80 is compatible. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed.  xamarinios10 is compatible. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Raygun4Xamarin.Forms:

Package Downloads
Xamariners.Logger.Mobile

Library for logger utilities for xamarine mobile apps.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 3,747 12/20/2023
1.2.0-pre-1 298 10/6/2023
1.1.1 704 8/23/2023
1.1.0 1,828 7/12/2023
1.0.10 3,543 3/3/2023
1.0.9 65,291 10/6/2021
1.0.9-beta 373 9/26/2021
1.0.8 516 9/6/2021
1.0.7 7,169 9/8/2020
1.0.6 1,293 8/18/2020
1.0.5 5,945 4/2/2020
1.0.4 19,777 3/13/2020
1.0.3 4,519 10/31/2019
1.0.2 610 10/30/2019
1.0.1 768 10/8/2019
1.0.0 1,626 6/24/2019
1.0.0-beta 559 6/6/2019