File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
mParticle-Apple-SDK-Swift/Sources/Utils Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -110,12 +110,19 @@ public class MPDevice: NSObject, NSCopying {
110110 get {
111111 if let arch = _architecture {
112112 return arch
113- } else {
114- guard let archRaw = NXGetLocalArchInfo ( ) . pointee. name else {
115- return " unknown "
113+ }
114+
115+ var systemInfo = utsname ( )
116+ uname ( & systemInfo)
117+
118+ let arch = withUnsafePointer ( to: & systemInfo. machine) {
119+ $0. withMemoryRebound ( to: CChar . self, capacity: 1 ) {
120+ String ( cString: $0)
116121 }
117- return String ( cString: archRaw)
118122 }
123+
124+ _architecture = arch
125+ return arch
119126 }
120127 set {
121128 _architecture = newValue
@@ -127,7 +134,7 @@ public class MPDevice: NSObject, NSCopying {
127134 }
128135
129136 @objc public var country : String ? {
130- return Locale . current. regionCode
137+ return Locale . current. region ? . identifier
131138 }
132139
133140 private var _deviceIdentifier : String ?
You can’t perform that action at this time.
0 commit comments