Skip to content

Step 3: Configuring the iOS project (if needed)

Ioannis Kokkinidis edited this page Oct 20, 2016 · 11 revisions
  1. Install the official iOS Bugsnag sdk into your app according to their iOS instructions.

    I chose the Cocoapods way meaning I just created a podfile in my projects iOS dir, added pod 'Bugsnag' in the podfile, and ran pod install.

  2. In your AppDelegate.m file, add the following code changes:

a. Import our RNBugsnag library within your AppDelegate.m file:

// Add just ONE of the following lines:

#import "RNBugsnag.h" // if installed by using Cocoapods

@implementation AppDelegate
  
  // ... other code

b. Initialize RNBugsnag inside of didFinishLaunchingWithOptions:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  // ... other code

  [RNBugsnag init];	//initialize it
  return YES;
}

c. Add your BUSNAG Api Key inside the Info.Plist file like so:

Add a new entry with a key of: `BUGSNAG_API_KEY` and a value of your Bugsnag API KEY (You can find that within [https://app.bugsnag.com/settings/\<WHATEVER_YOUR_PROJECT_NAME>/projects](https://bugsnag.com/settings/)).
Opening the `Info.Plist` with a text editor your addition should look like this:

```
<key>BUGSNAG_API_KEY</key>
<string>whatever_your_api_key_is</string>
```

Of course you only replace the string and not the key. But you already knew that I guess. Example: Your key should go here.

Clone this wiki locally