在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:airbrake/airbrake-ios开源软件地址:https://github.com/airbrake/airbrake-ios开源编程语言:Objective-C 91.0%开源软件介绍:Airbrake iOSIntroductionThe Airbrake iOS/Mac OS Notifier is designed to give developers instant notification of problems that occur in their apps. With just a few lines of code and a few extra files in your project, your app will automatically phone home whenever a crash or exception is encountered. These reports go straight to Airbrake where you can see information like backtrace, device type, app version, and more. SignalsThe notifier handles all unhandled exceptions, and a select list of Unix signals:
SymbolicationIn order for the call stack to be properly symbolicated at the time of a crash,
applications built with the notifier should not be stripped of their symbol
information at compile time. If these settings are not set as recommended,
frames from your binary will be displayed as hex return addresses instead of
readable strings. These hex return addresses can be symbolicated using
VersioningAirbrake supports a version floor for reported notices. A setting called "Latest
app version" is available in your project settings that lets you specify the
lowest app version for which crashes will be saved. This version is compared
using semantic versioning. The notifier uses your
InstallationDirectly from source code
From cocoapodsAdd this line:
UpgradingPlease remove all of the resources used by the notifier from your project before upgrading. This is the best way to make sure all of the appropriate files are present and no extra files exist. Find your project ID and project keyWith version 4.*, Airbrake iOS also requires your Airbrake project ID. To find
your Running the notifier in Swift as framework
And you're good to go. Running the notifier in Swift as static libraryWhen you add Airbrake iOS to your Swift project, Xcode will automatically add the bridging header for 'ABNotifier' class. When Xcode didn't generate the bridging header for your project, for example, you installed Airbrake iOS from cocoapods, you can create a bridge file manually.
First, set up the ABNotifer in your app delegate at the beginning of your 'func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {' ABNotifier.start(
withAPIKey: YOUR_API_KEY,
projectID: Your_Product_ID,
environmentName: ABNotifierAutomaticEnvironment,
useSSL: true
) Running the notifier in Objective-CThe To run the notifier you only need to complete two steps. First, import the
#import "ABNotifier.h" Next, call the start notifier method at the very beginning of your
[ABNotifier startNotifierWithAPIKey:@"YOUR_API_KEY"
projectID:@"Your_Product_ID"
environmentName:ABNotifierAutomaticEnvironment
delegate:self]; The API key argument expects your Airbrake project API key. The environment name you provide will be used to categorize received crash reports in the Airbrake web interface. The notifier provides several factory environment names that you are free to use.
The Environment VariablesAirbrake notices support custom environment variables. To add your own values to
this part of the notice, use the "environmentValue" family of methods found in
Custom Exception LoggingYou can log your own exceptions at any time. @try {
// something dangerous
}
@catch (NSException *e) {
[ABNotifier logException:e];
} When custom exception is used, the notifier will mirror the existing uncaught exception handler, and allow the application to catch and record exceptions without actually crashing. DebuggingTo test that the notifier is working inside your application, a simple test
method is provided. This method raises an exception, catches it, and reports it
as if a real crash happened. Add this code to your
[ABNotifier writeTestNotice]; Similarly you can call the test method in Swift. ABNotifier.writeTestNotice() If you use the Implementing the Delegate ProtocolThe MyAppDelegate.h #import ABNotifier.h
@interface MyAppDelegate : NSObject <UIApplicationDelegate, ABNotifierDelegate>
// your properties and methods
@end MyAppDelegate.m @implementation MyAppDelegate
// your other methods
#pragma mark - notifier delegate
/*
These are only a few of the delegate methods you can implement.
The rest are documented in ABNotifierDelegate.h. All of the
delegate methods are optional.
*/
- (void)notifierWillDisplayAlert {
[gameController pause];
}
- (void)notifierDidDismissAlert {
[gameController resume];
}
- (NSString *)titleForNoticeAlert {
return @"Oh Noes!";
}
- (NSString *)bodyForNoticeAlert {
return @"MyApp has detected unreported crashes, would you like to send a report to the developer?";
}
@end Supported versionsThe notifier requires iOS 6.0 or higher for iOS projects and Mac OS 10.7 or higher for Mac OS projects. It's also compitable with Swift. Current iOS Notifier version is 4.2.8. ContactIn case you have a problem, question or a bug report, feel free to:
LicenseThe project uses the MIT License. See LICENSE.md for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论