Skip to content

Commit

Permalink
Add api key to payload body (#232)
Browse files Browse the repository at this point in the history
Add backwards compatibility for older versions of the error reporting API
  • Loading branch information
fractalwrench authored and kattrali committed Jan 23, 2018
1 parent 1f8f370 commit 1dba09b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/BugsnagSink.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ - (void)filterReports:(NSArray *)reports
- (NSDictionary *)getBodyFromReports:(NSArray *)reports {
NSMutableDictionary *data = [[NSMutableDictionary alloc] init];
BSGDictSetSafeObject(data, [Bugsnag notifier].details, BSGKeyNotifier);
BSGDictSetSafeObject(data, [Bugsnag notifier].configuration.apiKey, BSGKeyApiKey);

NSMutableArray *formatted =
[[NSMutableArray alloc] initWithCapacity:[reports count]];
Expand Down
2 changes: 1 addition & 1 deletion Tests/BugsnagSinkTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (void)tearDown {
}

- (void)testCorrectTopLevelKeys {
NSArray *expectedKeys = @[@"events", @"notifier"];
NSArray *expectedKeys = @[@"apiKey", @"events", @"notifier"];
NSArray *topKeys = [self.processedData allKeys];
XCTAssertEqualObjects(
[topKeys sortedArrayUsingSelector:@selector(compare:)], expectedKeys);
Expand Down

0 comments on commit 1dba09b

Please sign in to comment.