-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amplitude dashboard with macOS filter return iPadOS statistics #132
Comments
@aureliendelrue - We fetch the OS information from |
Thank you for the suggestion @aureliendelrue. I'll keep this issue open so we can get more feedback from others who run into this issue and decide what can be done next. |
Hi ! Any news for the bug ? |
@izaaz Hi! Thank you for reply! But this is definitely a bug. From real-world environment perspective the actual system is MacOS. We'll be kindly appreciate if you add check for #if os(iOS)
if ProcessInfo.processInfo.isiOSAppOnMac {
log.info("[AU] Hello from macOS")
} else {
log.info("[AU] Hello from iOS")
}
#elseif os(macOS)
log.info("[AU] Hello from macOS")
#elseif targetEnvironment(macCatalyst)
log.info("[AU] Hello from Catalyst")
#endif |
@aureliendelrue the only thing I figured out as workaround is to write an enrichment plugin: final class PlatformEnrichmentPlugin: EnrichmentPlugin {
override func execute(event: BaseEvent?) -> BaseEvent? {
guard let event else { return nil }
event.userProperties = event.userProperties ?? [:]
event.eventProperties = event.eventProperties ?? [:]
event.groupProperties = event.groupProperties ?? [:]
func forceMacOS() {
event.platform = "macOS"
event.deviceModel = "macOS_Unknown_" + (event.deviceModel ?? "")
event.osVersion = ProcessInfo.processInfo.operatingSystemVersionString
event.osName = "macOS_" + (event.osName ?? "")
}
#if os(iOS)
if ProcessInfo.processInfo.isiOSAppOnMac {
forceMacOS()
}
#elseif os(macOS) || targetEnvironment(macCatalyst)
forceMacOS()
#endif
return event
}
} and then add it with aimplitude.add(plugin: PlatformEnrichmentPlugin()) This will definitely give us correct platform. But detecting environment is tricky part. I was able to get MacOS version from ProcessInfo, but OS Name / Model - is quite difficult to figure out (I found several approaches with touching system plists, but haven't tested them yet). If anyone can offer a working solution - please post it here. Above plugin will give you these |
On the Amplitude dashboard, if I want statistics about macOS version, the dashboard retrieve iPadOS data.
The text was updated successfully, but these errors were encountered: