Skip to content

Commit

Permalink
✨ Add _timezoneOffset auto property
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed Oct 7, 2024
1 parent c5066ef commit e8e3a5a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ internal class AutoPropertyDecorator: AnalyticsDecorating {
"_sdkName": "appcues-ios",
"_osVersion": UIDevice.current.systemVersion,
"_deviceType": UIDevice.current.userInterfaceIdiom.analyticsName,
"_deviceModel": UIDevice.current.modelName
"_deviceModel": UIDevice.current.modelName,
"_timezoneOffset": TimeZone.current.minutesFromGMT()
]
}()

Expand Down Expand Up @@ -183,6 +184,12 @@ extension UIDevice {
}
}

extension TimeZone {
func minutesFromGMT() -> Int {
TimeZone.current.secondsFromGMT() / 60
}
}

extension TrackingUpdate {
// events have auto props nested inside an _identity object
var identityAutoProperties: [String: Any]? {
Expand Down

0 comments on commit e8e3a5a

Please sign in to comment.