Skip to content

Commit

Permalink
feat: Add osBuild as a reported device value (#298)
Browse files Browse the repository at this point in the history
This adds `osBuild` as a new value that's being reported for every
device. This can be useful to tell apart release versions from beta
versions of the OS.

The technical name used by `sysctl` is "os version", but since the
`osVersion` key was already in use for reporting the marketing version
(e.g. 11.4), I used `osBuild` as the key instead.
  • Loading branch information
sberrevoets authored and kattrali committed Jul 20, 2018
1 parent 3bcecaf commit 59dc4d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Source/BugsnagKSCrashSysInfoParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
BSGDictSetSafeObject(deviceState, report[@"machine"], @"model");
BSGDictSetSafeObject(deviceState, report[@"system_name"], @"osName");
BSGDictSetSafeObject(deviceState, report[@"system_version"], @"osVersion");
BSGDictSetSafeObject(deviceState, report[@"os_version"], @"osBuild");
BSGDictSetSafeObject(deviceState, @(PLATFORM_WORD_SIZE), @"wordSize");
BSGDictSetSafeObject(deviceState, @"Apple", @"manufacturer");
BSGDictSetSafeObject(deviceState, report[@"jailbroken"], @"jailbroken");
Expand Down
2 changes: 1 addition & 1 deletion Tests/BugsnagSessionTrackingPayloadTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)testPayloadSerialisation {
- (void)testDeviceSerialisation {
NSDictionary *device = self.payload[@"device"];
XCTAssertNotNil(device);
XCTAssertEqual(7, device.count);
XCTAssertEqual(8, device.count);

XCTAssertEqualObjects(device[@"manufacturer"], @"Apple");
XCTAssertNotNil(device[@"model"]);
Expand Down
5 changes: 3 additions & 2 deletions Tests/BugsnagSinkTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ - (void)testEventDevice {
NSDictionary *device = event[@"device"];
XCTAssertNotNil(device);
#if TARGET_OS_IPHONE || TARGET_OS_TV || TARGET_IPHONE_SIMULATOR
XCTAssertEqual(17, device.count);
XCTAssertEqual(18, device.count);
#else
XCTAssertEqual(16, device.count);
XCTAssertEqual(17, device.count);
#endif

XCTAssertEqualObjects(device[@"id"], @"f6d519a74213a57f8d052c53febfeee6f856d062");
Expand All @@ -270,6 +270,7 @@ - (void)testEventDevice {
XCTAssertEqualObjects(device[@"modelNumber"], @"MacBookPro11,3");
XCTAssertEqualObjects(device[@"osName"], @"iPhone OS");
XCTAssertEqualObjects(device[@"osVersion"], @"8.1");
XCTAssertEqualObjects(device[@"osBuild"], @"14B25");
XCTAssertEqualObjects(device[@"totalMemory"], @15065522176);
XCTAssertNotNil(device[@"freeDisk"]);
XCTAssertEqualObjects(device[@"timezone"], @"PST");
Expand Down

0 comments on commit 59dc4d7

Please sign in to comment.