Skip to content

Commit

Permalink
Merge pull request #985 from BranchMetrics/SDK-717-fix-for-0.31.x-bre…
Browse files Browse the repository at this point in the history
…aking-on-server-update

SDK-717 convert cpu type to a string
  • Loading branch information
echo-branch authored Dec 19, 2019
2 parents 175fcc3 + 9824a7a commit 094e894
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Branch-SDK-Tests/BNCDeviceInfoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ - (void)testExtensionType {
}

- (void)testCpuType_Simulator {
NSNumber *expected = @(7);
XCTAssert([expected isEqualToNumber:self.deviceInfo.cpuType]);
NSString *expected = @"7";
XCTAssert([expected isEqualToString:self.deviceInfo.cpuType]);
}

//- (void)testCpuType_iPhone7 {
// NSNumber *expected = @(16777228);
// XCTAssert([expected isEqualToNumber:self.deviceInfo.cpuType]);
// NSString *expected = @"16777228";
// XCTAssert([expected isEqualToString:self.deviceInfo.cpuType]);
//}

- (void)testScreenWidth {
Expand Down
2 changes: 1 addition & 1 deletion Branch-SDK/Branch-SDK/BNCDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@property (nonatomic, copy, readwrite) NSString *osVersion;
@property (nonatomic, copy, readwrite) NSString *osBuildVersion;
@property (nonatomic, copy, readwrite) NSString *extensionType;
@property (nonatomic, copy, readwrite) NSNumber *cpuType;
@property (nonatomic, copy, readwrite) NSString *cpuType;
@property (nonatomic, copy, readwrite) NSNumber *screenWidth;
@property (nonatomic, copy, readwrite) NSNumber *screenHeight;
@property (nonatomic, copy, readwrite) NSNumber *screenScale;
Expand Down
6 changes: 5 additions & 1 deletion Branch-SDK/Branch-SDK/BNCDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ - (void)loadDeviceInfo {
self.osName = [BNCSystemObserver getOS];
self.osVersion = [BNCSystemObserver getOSVersion];
self.osBuildVersion = deviceSystem.systemBuildVersion;
self.cpuType = deviceSystem.cpuType;

if (deviceSystem.cpuType) {
self.cpuType = [deviceSystem.cpuType stringValue];
}

self.screenWidth = [BNCSystemObserver getScreenWidth];
self.screenHeight = [BNCSystemObserver getScreenHeight];
self.screenScale = @([UIScreen mainScreen].scale);
Expand Down

0 comments on commit 094e894

Please sign in to comment.