Skip to content

Commit

Permalink
fix: fix userId is overwritten by deviceId and make reset public (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhao900914 authored Jan 20, 2023
1 parent 7f3449f commit 4f49720
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Amplitude/Amplitude.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class Amplitude {
_ = setUserId(userId: eventOptions.userId)
}
if eventOptions.deviceId != nil {
_ = setUserId(userId: eventOptions.deviceId)
_ = setDeviceId(deviceId: eventOptions.deviceId)
}
}
process(event: event)
Expand Down Expand Up @@ -251,7 +251,7 @@ public class Amplitude {
}

@discardableResult
func reset() -> Amplitude {
public func reset() -> Amplitude {
_ = setUserId(userId: nil)
_ = setDeviceId(deviceId: nil)
contextPlugin.initializeDeviceId()
Expand Down

0 comments on commit 4f49720

Please sign in to comment.