Skip to content

Commit

Permalink
Add attributes change
Browse files Browse the repository at this point in the history
Add attributes change
  • Loading branch information
oaliaga committed Jan 17, 2024
1 parent cd4c40c commit 044b5d7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Prey/Classes/PreyDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PreyDevice {
// MARK: Functions

// Init function
fileprivate init() {
init() {
name = UIDevice.current.name
type = (IS_IPAD) ? "Tablet" : "Phone"
os = "iOS"
Expand Down
24 changes: 23 additions & 1 deletion Prey/Classes/PreyNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,29 @@ class PreyNotification {
PreyLogger("Did register device token")
let tokenAsString = deviceToken.reduce("") { $0 + String(format: "%02x", $1) }
PreyLogger(tokenAsString)
let params:[String: String] = ["notification_id" : tokenAsString, "name" : UIDevice.current.name]
let preyDevice = PreyDevice()
let firmwareInfo : [String:String] = [
"model_name": preyDevice.model!,
"vendor_name": preyDevice.vendor!,
]
let processorInfo : [String:String] = [
"speed": preyDevice.cpuSpeed!,
"cores": preyDevice.cpuCores!,
"model": preyDevice.cpuModel!,
]
let specs : [String: Any] = [
"processor_info": processorInfo,
"firmware_info": firmwareInfo,
]
let hardwareAttributes : [String:String] = [
"ram_size" : preyDevice.ramSize!
]
let params:[String: Any] = [
"notification_id" : tokenAsString,
"name" : UIDevice.current.name,
"specs": specs,
"hardware_attributes":hardwareAttributes
]

// Check userApiKey isn't empty
if let username = PreyConfig.sharedInstance.userApiKey {
Expand Down

0 comments on commit 044b5d7

Please sign in to comment.