File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ - (instancetype)init {
41
41
self.osContext = [self generatedOsContext ];
42
42
}
43
43
[serializedData setValue: self .osContext forKey: @" os" ];
44
-
44
+ [self fixSystemName ];
45
+
45
46
if (nil == self.appContext ) {
46
47
self.appContext = [self generatedAppContext ];
47
48
}
@@ -55,6 +56,13 @@ - (instancetype)init {
55
56
return serializedData;
56
57
}
57
58
59
+ - (void )fixSystemName {
60
+ // This fixes iPhone OS to iOS because apple messed up the naming
61
+ if (nil != self.osContext && [self .osContext[@" name" ] isEqualToString: @" iPhone OS" ]) {
62
+ [self .osContext setValue: @" iOS" forKey: @" name" ];
63
+ }
64
+ }
65
+
58
66
- (NSDictionary <NSString *, id> *)generatedOsContext {
59
67
NSMutableDictionary *serializedData = [NSMutableDictionary new ];
60
68
Original file line number Diff line number Diff line change @@ -89,6 +89,10 @@ - (void)testRawWithCrashReport {
89
89
- (void )testAbort {
90
90
reportPath = @" Resources/Abort" ;
91
91
[self isValidReport ];
92
+ NSDictionary *rawCrash = [self getCrashReport ];
93
+ SentryKSCrashReportConverter *reportConverter = [[SentryKSCrashReportConverter alloc ] initWithReport: rawCrash];
94
+ SentryEvent *event = [reportConverter convertReportToEvent ];
95
+ XCTAssertEqualObjects ([[event serialize ] valueForKeyPath: @" contexts.os.name" ], @" iOS" );
92
96
}
93
97
94
98
- (void )testMissingBinary {
You can’t perform that action at this time.
0 commit comments