Skip to content

Commit

Permalink
fix: Don't use idfv for deviceId if invalid (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
crleona committed Jun 14, 2024
1 parent ea78e75 commit f17e7fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Amplitude/Plugins/ContextPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ class ContextPlugin: BeforePlugin {
return
}
if deviceId == nil, amplitude?.configuration.trackingOptions.shouldTrackIDFV() ?? false {
deviceId = staticContext["idfv"] as? String
if let idfv = staticContext["idfv"] as? String, idfv != "00000000-0000-0000-0000-000000000000" {
deviceId = idfv
}
}
if deviceId == nil {
deviceId = NSUUID().uuidString
Expand Down

0 comments on commit f17e7fa

Please sign in to comment.