Skip to content

Commit 044b5d7

Browse files
committed
Add attributes change
Add attributes change
1 parent cd4c40c commit 044b5d7

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Prey/Classes/PreyDevice.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class PreyDevice {
3030
// MARK: Functions
3131

3232
// Init function
33-
fileprivate init() {
33+
init() {
3434
name = UIDevice.current.name
3535
type = (IS_IPAD) ? "Tablet" : "Phone"
3636
os = "iOS"

Prey/Classes/PreyNotification.swift

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,29 @@ class PreyNotification {
8080
PreyLogger("Did register device token")
8181
let tokenAsString = deviceToken.reduce("") { $0 + String(format: "%02x", $1) }
8282
PreyLogger(tokenAsString)
83-
let params:[String: String] = ["notification_id" : tokenAsString, "name" : UIDevice.current.name]
83+
let preyDevice = PreyDevice()
84+
let firmwareInfo : [String:String] = [
85+
"model_name": preyDevice.model!,
86+
"vendor_name": preyDevice.vendor!,
87+
]
88+
let processorInfo : [String:String] = [
89+
"speed": preyDevice.cpuSpeed!,
90+
"cores": preyDevice.cpuCores!,
91+
"model": preyDevice.cpuModel!,
92+
]
93+
let specs : [String: Any] = [
94+
"processor_info": processorInfo,
95+
"firmware_info": firmwareInfo,
96+
]
97+
let hardwareAttributes : [String:String] = [
98+
"ram_size" : preyDevice.ramSize!
99+
]
100+
let params:[String: Any] = [
101+
"notification_id" : tokenAsString,
102+
"name" : UIDevice.current.name,
103+
"specs": specs,
104+
"hardware_attributes":hardwareAttributes
105+
]
84106

85107
// Check userApiKey isn't empty
86108
if let username = PreyConfig.sharedInstance.userApiKey {

0 commit comments

Comments
 (0)