iOS Library Documentation

Installation is easy as pie (and twice as delicious):

1

Download the Super Duper Library

2

Unzip it and drag the "CrittercismSDK" subfolder into your XCode project

3

Add QuartzCore and SystemConfiguration

For iOS 3.x support, weak-link the UIKit framework.

Initialize Crittercism:

1. Add #import "Crittercism.h" in the top of your appDelegate header file

2. Add this line of code in your AppDelegate's didFinishLaunchingWithOptions method (make sure you replace "<YOUR_UIVIEWCONTROLLER>" with the view controller that will present the feedback forum). If your view controller is not available in the app delegate, you can pass nil as the mainViewController.

[Crittercism initWithAppID: @"4ce2d43766d78766a1000013"
    andKey:@"4ce2d43766d78766a1000013pyat0f4l"
    andSecret:@"irv8zk5b4xvrbzuo3pghlck9mh2fdewa"
    andMainViewController:<YOUR_UIVIEWCONTROLLER>];

If you are not using the support forum, use this code:

[Crittercism initWithAppID: @"4ce2d43766d78766a1000013"
    andKey:@"4ce2d43766d78766a1000013pyat0f4l"
    andSecret:@"irv8zk5b4xvrbzuo3pghlck9mh2fdewa"];

Copy and paste the code above for your "Demo App" app. Otherwise, you can find the appID, oAuth key, and oAuth secret in your app settings.

Notes:
> If you're not using the support forum, you can pass 'nil' as the mainViewController.
> If you initialize your view controller elsewhere, you can pass 'nil' here, and then use [Crittercism showCrittercism:myViewController]; later on.

You now have crash reporting integrated!

To Test Crash Reporting:

If you throw an unhandled exception, it will be automatically sent to the web portal along with some awesome diagnostics.

Try it out! Create a button that throws an exception:

-(IBAction) crashPressed:(id) sender {
    [NSException raise:NSInvalidArgumentException
                format:@"Foo must not be nil"];
}
After the app crashes, go to your crash summary page to view your crashes! Alternatively, you could view your crashes and app loads occur in real time in the overview page.

Note:
If you're using v3.0 or above of the library, app crashes are sent on the NEXT app load. You will ALSO need to disconnect the Xcode GDB debugger in the simulator (as that will capture the app crash). Make sure you watch this video first!

Congratulations! You just added crash reporting to your iphone app!

Bonus: There are a slew of optional methods you can add on top of crash reporting that will make your life easier.

Sometimes a stack trace just isn't enough. You can add additional debugging statements to your code, and see exactly what the user was doing right before a crash under the Breadcrumbs tab.

[Crittercism leaveBreadcrumb:@"<breadcrumb>"];

For example, this is what you would see if you added breadcrumbs to your app:

Breadcrumbs Example Screenshot

More Optional Methods

Wanna add metadata to your users?

Well you're in luck! Check out our optional methods for more informational goodness!

Confused?

We know nothing is ever perfect (well, maybe except Andrew's 6 pack), so feel free to send us email if anything is confusing, if you have a feature that would make your day, or if you just wanna say hi!