Skip to content

Commit

Permalink
add platform name property
Browse files Browse the repository at this point in the history
  • Loading branch information
pelumy committed Jan 15, 2025
1 parent 8d05a64 commit 3119e9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Nos/Extensions/UIDevice+Simulator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ extension UIDevice {
static var isSimulator: Bool {
ProcessInfo.processInfo.environment["SIMULATOR_DEVICE_NAME"] != nil
}

static var platformName: String {
#if os(iOS)
return UIDevice.current.systemName
#elseif os(macOS)
return "macOS"
#endif
}
}
5 changes: 3 additions & 2 deletions Nos/Service/Analytics.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
import UIKit
import PostHog
import Dependencies
import Logger
Expand Down Expand Up @@ -172,7 +172,8 @@ class Analytics {
"Installation Source",
properties: [
"source": source.rawValue,
"App Version": Bundle.current.versionAndBuild
"platform": UIDevice.platformName,
"app_version": Bundle.current.versionAndBuild
]
)
// Mark as tracked so we don't track again
Expand Down

0 comments on commit 3119e9e

Please sign in to comment.