Skip to content

Commit

Permalink
Merge pull request #8 from dfujiwara/master
Browse files Browse the repository at this point in the history
Add flag for enabling crash reporter
  • Loading branch information
coryvirok committed Jan 28, 2015
2 parents 5df9137 + a8e0b51 commit 6487352
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 6487352

Please sign in to comment.