Introduction
Welcome to the documentation for SFBCrashReporter, a crash reporting library for iOS applications. This library allows you to easily collect and track crashes in your app, providing you with valuable insights for debugging and improving your application’s stability.
Installation
Using CocoaPods
To install SFBCrashReporter using CocoaPods, add the following line to your project’s Podfile
:
// Podfile
pod 'SFBCrashReporter'
Then, run pod install
to install the library into your project.
Manual Installation
If you prefer to install the library manually, follow these steps:
- Download the SFBCrashReporter source code.
- Unzip the downloaded file and locate the
SFBCrashReporter
directory. - Drag and drop the
SFBCrashReporter
directory into your Xcode project. - Make sure to select “Copy items if needed” when prompted.
Usage
Initialization
To initialize SFBCrashReporter in your app, you need to add the following code:
// AppDelegate.m
import SFBCrashReporter
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
// Initialize SFBCrashReporter
[SFBCrashReporter initializeWithAppKey:@"YOUR_APP_KEY"];
// Your remaining app initialization code...
return YES;
}
Make sure to replace YOUR_APP_KEY
with the unique key provided to you after signing up for SFBCrashReporter.
Customization
SFBCrashReporter provides the following customization options:
enableConsoleLogging
: Enables or disables console logging for crash reports. Default isYES
.enableEmailReports
: Enables or disables email crash reports. Default isNO
.emailAddress
: The email address to which crash reports will be sent. Mandatory ifenableEmailReports
is set toYES
.enableScreenshotAttachment
: Enables or disables attaching screenshots to crash reports. Default isNO
.
To customize these options, use the following methods:
// Customization example
[SFBCrashReporter sharedInstance].enableConsoleLogging = NO;
[SFBCrashReporter sharedInstance].enableEmailReports = YES;
[SFBCrashReporter sharedInstance].emailAddress = @"your@email.com";
[SFBCrashReporter sharedInstance].enableScreenshotAttachment = YES;
Additional Features
Symbolication
SFBCrashReporter supports symbolication of crash reports. Symbolication replaces memory addresses in crash logs with human-readable method names, making it easier to understand the cause of the crash.
Version Tracking
The library automatically tracks the app’s version and build number. This information can be useful when analyzing crash reports across different app versions.
Record Custom Logs
You can record custom logs in SFBCrashReporter using the recordLog:
method. This allows you to log additional information related to a specific crash or event.
Troubleshooting
If you are experiencing any issues with SFBCrashReporter, make sure to:
- Check that you have correctly initialized the library with the appropriate app key.
- Ensure that you have a stable internet connection for crash report submission.
- Verify that the email address for crash reports is correctly set if email reports are enabled.
- Review the console logs for any error messages related to SFBCrashReporter.
- Contact our support team at support@yourcompany.com for further assistance.
Conclusion
Congratulations! You have successfully integrated SFBCrashReporter into your iOS application. You should now be able to track and analyze crashes for a more stable and reliable app. If you have any questions or need further assistance, please don’t hesitate to contact our support team.