Raygun for Xamarin.iOS supports Unified API and native error reporting

Jason FauchelleProvider Updates1 Comment

Raygun is an error tracking service that works in a large variety of languages and platforms. Raygun4Net is a library to add to your .NET applications such as Xamarin.iOS. This gives you awareness into the errors occurring in your published apps so that you can fix them fast.

native ios errors

Unified API 64-bit support

If you’re a Xamarin.iOS developer, then you probably know of the upcoming 64-bit Apple requirements, and the Unified API that Xamarin is providing to help with this. 3rd party libraries/components that you use in your updated apps will also need to support the Unified API, and so the latest version of Raygun4Net is ready to go in both the Xamarin Component Store and NuGet. Update to the latest version of Raygun4Net now to get error reporting in your 64-bit apps. And if you were wondering – both the Xamarin Component and NuGet package will continue to support the classic API for as long as Xamarin does.

Native error reporting

In addition to the Unified API support, the native error reporting support that was previously in beta has now moved into the latest stable release of Raygun4Net. Needless to say, this functionality is available in both the Unified and Classic API versions.

Raygun can be set up with a single line of code in your Xamarin.iOS applications. If you’re already using Raygun4Net, then the existing behavior of your code will be maintained which is to only report managed exceptions, but by modifying this single line of code with a couple of boolean parameters, native error reporting will be enabled:

The first boolean parameter is simply to enable native iOS error reporting.

The second boolean parameter is whether or not to hijack some of the native signals – this is to solve the well known iOS crash reporter issue where null reference exceptions within a try/catch block can cause the application to crash. By setting the second boolean parameter to true, the managed code will take over the SIGBUS and SIGSEGV iOS signals which solves the null reference issue. Doing this however prevents SIGBUS and SIGSEGV native errors from being detected, meaning they don’t get sent to Raygun. This is why we provide this as an option – so if you don’t have any issues with null reference exceptions occurring within try/catch blocks and you want to maximize the native errors that you can be notified of, then set the second boolean parameter to false.

Now Raygun can report native errors occurring in your managed Xamarin.iOS apps. Note that it is unsafe to send native errors at the time an app has crashed, and so native reports are first safely saved to the device and then sent the next time the app starts up. Managed exceptions however will still be sent instantly.

Native error symbolication

Native error reporting is all good and nice, but they don’t mean much until they’ve been symbolicated with a dSYM. And so, simply by uploading a dSYM file to your account, Raygun will symbolicate your native iOS crash reports for you. This results in readable stack traces for both managed and native code that will make quick work for tracking down those bugs.

To upload a dSYM, go to your Raygun dashboard, click “Application Settings” in the side bar, and then click “dSYM Center” that appears below it.

Upload dSYM

Zip up the dSYM file that Xamarin generates in the bin folder of your project, then drag and drop it on to the dSYM upload panel shown above. Note that every time you build your application, a new dSYM will be created, even if no code was changed – so make sure to always upload the dSYM file for each build that you want to track errors from.

Try it today

Looking for excellent error reporting in your Xamarin.iOS applications? Try out Raygun for free with support for Unified API 64-bit apps and native error reporting.

Next level software intelligence across your entire stack.

One Comment on “Raygun for Xamarin.iOS supports Unified API and native error reporting”

  1. Pingback: Report native iOS errors with Raygun's new beta Xamarin provider

Leave a Reply

Your email address will not be published. Required fields are marked *