Raygun crash reporting and error monitoring is available for iOStvOS & macOS with the raygun4apple provider. This provider can be used with both Objective-C and Swift applications.


note: The Raygun4Apple provider is developed as a “fat” library, which includes architectures for both simulators and devices. You will need to strip out the simulator architectures (x86_64, i386) before releasing. There is a helpful article on how to do this here.

1. Install the Raygun4Apple package

Download the latest package installer from here. Run the installer and follow the on-screen instructions.

Raygun4apple installation

2. Reference Raygun4Apple in your project

To use the framework in an app project, you will need to first select the Project in the Project Navigator. Then select the Target for the Project and scroll down to the Embedded Binaries section.

Raygun4apple installation

Next, in Finder, open the Library > Frameworks > raygun4apple directory. Open the folder corresponding to the platform your Target is currently supporting. Select the raygun4apple.framework file and drag it into the Embedded Binaries section.

3. Add the import dependency

For Swift projects you must create an Objective-C bridging header to be able to import the provider’s umbrella header file. You can find out how to do this by visiting Apple’s documentation for more details.

In your AppDelegate’s source file or Objective-C bridging header file, import the umbrella header for your target platform.

For iOS

#import <raygun4apple/raygun4apple_iOS.h>

For tvOS

#import <raygun4apple/raygun4apple_tvOS.h>

For macOS

#import <raygun4apple/raygun4apple_macOS.h>

4. Start the Raygun crash reporter

In your AppDelegate’s application function, add the following code to start the Raygun crash reporter. Your app API key is displayed when you create a new application in your Raygun account, or can be viewed in the application settings.


RaygunClient *raygunClient = [RaygunClient sharedInstanceWithApiKey:@"YOUR_APP_API_KEY"];
[raygunClient enableCrashReporting];


let raygunClient = RaygunClient.sharedInstance(apiKey: "YOUR_APP_API_KEY")

User tracking

This provider supports tracking the unique users who encounter errors and crashes in your mobile apps.

The identifier property on the RaygunUserInformation class is what separates one user from another. Be sure to set it with something unique, for example a database id, username or email address.

If the user changes, for instance when logging in or out, be sure to update the user information on the shared Raygun client each time. You can assign user information as described below.


RaygunUserInformation *userInfo = [[RaygunUserInformation alloc] initWithIdentifier:@""
                                                                      withFullName:@"Test User"
RaygunClient.sharedInstance.userInformation = userInfo;


let userInformation = RaygunUserInformation(identifier: "", email: "", fullName: "Test User", firstName: "Test")
RaygunClient.sharedInstance().userInformation = userInformation