.NET for iOS

Raygun offers comprehensive crash reporting tools for .NET applications on Apple platforms, including iOS, tvOS, and macOS. With Raygun Crash Reporting, you can efficiently track and resolve issues impacting your application's performance.


Before proceeding, ensure you have:

  • A Raygun account and a valid API key.
  • A .NET 6+ project for .NET on Apple platforms.

note: This page focuses on .NET native apps for Apple devices. For other frameworks, see .NET MAUI or .NET Xamarin.




  1. Install the Raygun4Net Provider: Ensure that your .NET project has the Raygun4Net provider installed. You can install the Raygun4Net.NetCore NuGet package via the Package Manager Console:

    dotnet add package Mindscape.Raygun4Net.NetCore
    
  2. Initialize Raygun in Your Apple Application: In your AppDelegate, initialize the RaygunClient with your API key. This ensures all unhandled exceptions are reported automatically.

    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) {
       var raygunSettings = new RaygunSettings
       {
           ApiKey = "paste_your_api_key_here",
           CatchUnhandledExceptions = true // automatically reports any unhandled exceptions to Raygun
       };
    
       var _raygunClient = new RaygunClient(raygunSettings); // Ideally add this as a service to inject
    
       return true;
     }
    
  3. Configure Info.plist (Optional): Make sure your application has the necessary permissions declared within your Info.plist, if applicable, to support collection of additional diagnostics.

  4. Test Your Setup:

  • Test your implementation by simulating crash scenarios in a development environment.
  • Ensure crash reports are received and displayed in the Raygun dashboard.
  1. Deployment: Deploy your application to production. Continuously monitor crash reports in Raygun's dashboard to ensure all unhandled exceptions are being captured and resolved promptly.

By following these steps, your .NET for iOS application will be equipped with robust unhandled crash reporting, enabling you to maintain optimal application performance and reliability.

For more detailed information and advanced configurations, please refer to the .NET 6+ documentation: Crash Reporting for .NET 6+.