Skip to content

Commit 094e894

Browse files
authored
Merge pull request #985 from BranchMetrics/SDK-717-fix-for-0.31.x-breaking-on-server-update
SDK-717 convert cpu type to a string
2 parents 175fcc3 + 9824a7a commit 094e894

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Branch-SDK-Tests/BNCDeviceInfoTests.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ - (void)testExtensionType {
5959
}
6060

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

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

7171
- (void)testScreenWidth {

Branch-SDK/Branch-SDK/BNCDeviceInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
@property (nonatomic, copy, readwrite) NSString *osVersion;
4646
@property (nonatomic, copy, readwrite) NSString *osBuildVersion;
4747
@property (nonatomic, copy, readwrite) NSString *extensionType;
48-
@property (nonatomic, copy, readwrite) NSNumber *cpuType;
48+
@property (nonatomic, copy, readwrite) NSString *cpuType;
4949
@property (nonatomic, copy, readwrite) NSNumber *screenWidth;
5050
@property (nonatomic, copy, readwrite) NSNumber *screenHeight;
5151
@property (nonatomic, copy, readwrite) NSNumber *screenScale;

Branch-SDK/Branch-SDK/BNCDeviceInfo.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ - (void)loadDeviceInfo {
7979
self.osName = [BNCSystemObserver getOS];
8080
self.osVersion = [BNCSystemObserver getOSVersion];
8181
self.osBuildVersion = deviceSystem.systemBuildVersion;
82-
self.cpuType = deviceSystem.cpuType;
82+
83+
if (deviceSystem.cpuType) {
84+
self.cpuType = [deviceSystem.cpuType stringValue];
85+
}
86+
8387
self.screenWidth = [BNCSystemObserver getScreenWidth];
8488
self.screenHeight = [BNCSystemObserver getScreenHeight];
8589
self.screenScale = @([UIScreen mainScreen].scale);

0 commit comments

Comments
 (0)