Skip to content

Commit

Permalink
Renamed RollbarCrashReport to RollbarRawCrashReport in RollbarNotifier (
Browse files Browse the repository at this point in the history
#313)

This avoids collisions with RollbarCrash.RollbarCrashReport when integrating Rollbar via Cocoapods.
  • Loading branch information
matux authored Jul 21, 2023
1 parent 4cc2699 commit 7eff014
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
10 changes: 5 additions & 5 deletions RollbarNotifier/Sources/RollbarNotifier/DTOs/RollbarBody.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "RollbarBody.h"

#import "RollbarMessage.h"
#import "RollbarCrashReport.h"
#import "RollbarRawCrashReport.h"
#import "RollbarTrace.h"
#import "RollbarTelemetry.h"
#import "RollbarTelemetryEvent.h"
Expand All @@ -27,15 +27,15 @@ - (void)setMessage:(RollbarMessage *)message {
[self setDictionary:message.jsonFriendlyData forKey:DFK_MESSAGE];
}

- (nullable RollbarCrashReport *)crashReport {
- (nullable RollbarRawCrashReport *)crashReport {
id data = [self getDataByKey:DFK_CRASH_REPORT];
if (data != nil) {
return [[RollbarCrashReport alloc] initWithDictionary:data];
return [[RollbarRawCrashReport alloc] initWithDictionary:data];
}
return nil;
}

- (void)setCrashReport:(RollbarCrashReport *)crashReport {
- (void)setCrashReport:(RollbarRawCrashReport *)crashReport {
[self setDictionary:crashReport.jsonFriendlyData forKey:DFK_CRASH_REPORT];
}

Expand Down Expand Up @@ -132,7 +132,7 @@ -(instancetype)initWithCrashReport:(nonnull NSString *)crashReport {

self = [super initWithDictionary:@{
DFK_MESSAGE: [NSNull null],
DFK_CRASH_REPORT: [[RollbarCrashReport alloc] initWithRawCrashReport:crashReport].jsonFriendlyData,
DFK_CRASH_REPORT: [[RollbarRawCrashReport alloc] initWithRawCrashReport:crashReport].jsonFriendlyData,
DFK_TRACE: [NSNull null],
// if/when we do allow a trace side-by-side with the crash report use the following line instead of code line above:
//DFK_TRACE: [[RollbarTrace alloc] initWithCrashReport:crashReport].jsonFriendlyData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#import "RollbarCrashReport.h"
#import <Foundation/Foundation.h>
#import "RollbarRawCrashReport.h"

static NSString * const DFK_RAW = @"raw";

@implementation RollbarCrashReport
@implementation RollbarRawCrashReport

#pragma mark - Properties

Expand Down
4 changes: 2 additions & 2 deletions RollbarNotifier/Sources/RollbarNotifier/include/RollbarBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@class RollbarTelemetry;
@class RollbarTrace;
@class RollbarMessage;
@class RollbarCrashReport;
@class RollbarRawCrashReport;
@class RollbarTelemetryEvent;

NS_ASSUME_NONNULL_BEGIN
Expand Down Expand Up @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN

// Payload Option 4: "crash_report"
// Only one of "trace", "trace_chain", "message", or "crash_report" should be present.
@property (nonatomic, strong, nullable) RollbarCrashReport *crashReport;
@property (nonatomic, strong, nullable) RollbarRawCrashReport *crashReport;

#pragma mark - Optional properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#import "RollbarCallStackFrame.h"
#import "RollbarCallStackFrameContext.h"
#import "RollbarException.h"
#import "RollbarCrashReport.h"
#import "RollbarRawCrashReport.h"
#import "RollbarConfig.h"
#import "RollbarServerConfig.h"
#import "RollbarDestination.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef RollbarCrashReport_h
#define RollbarCrashReport_h
#ifndef RollbarRawCrashReport_h
#define RollbarRawCrashReport_h

@import RollbarCommon;

NS_ASSUME_NONNULL_BEGIN

/// Crash report payload element
@interface RollbarCrashReport : RollbarDTO
@interface RollbarRawCrashReport : RollbarDTO

#pragma mark - Properties

Expand All @@ -25,4 +25,4 @@ NS_ASSUME_NONNULL_BEGIN

NS_ASSUME_NONNULL_END

#endif //RollbarCrashReport_h
#endif //RollbarRawCrashReport_h

0 comments on commit 7eff014

Please sign in to comment.