Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag for enabling crash reporter #8

Merged
merged 1 commit into from
Jan 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Rollbar/Rollbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

@interface Rollbar : NSObject

+ (void)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration
enableCrashReporter:(BOOL)enable;
+ (void)initWithAccessToken:(NSString*)accessToken;
+ (void)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration;

Expand Down
11 changes: 9 additions & 2 deletions Rollbar/Rollbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,19 @@ + (void)initWithAccessToken:(NSString *)accessToken {
}

+ (void)initWithAccessToken:(NSString *)accessToken configuration:(RollbarConfiguration*)configuration {
[self initWithAccessToken:accessToken configuration:configuration enableCrashReporter:YES];
}

+ (void)initWithAccessToken:(NSString *)accessToken configuration:(RollbarConfiguration*)configuration
enableCrashReporter:(BOOL)enable {
if (notifier) {
RollbarLog(@"Rollbar has already been initialized.");
} else {
notifier = [[RollbarNotifier alloc] initWithAccessToken:accessToken configuration:configuration isRoot:YES];

[self enableCrashReporter];

if (enable) {
[self enableCrashReporter];
}

[notifier.configuration save];
}
Expand Down