Skip to content

Commit

Permalink
per comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jimexist committed May 20, 2024
1 parent a7002b8 commit 641aa01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions posthog/src/main/java/com/posthog/PostHog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ public class PostHog private constructor(
anonymousId = getPreferences().getValue(ANONYMOUS_ID) as? String
if (anonymousId.isNullOrBlank()) {
var uuid = UUID.randomUUID()
// when getDeviceId method is available, pass-through the value
config?.getDeviceId?.let { uuid = it(uuid) }
// when getAnonymousId method is available, pass-through the value for modification
config?.getAnonymousId?.let { uuid = it(uuid) }
anonymousId = uuid.toString()
this.anonymousId = anonymousId ?: ""
}
Expand Down
2 changes: 1 addition & 1 deletion posthog/src/main/java/com/posthog/PostHogConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public open class PostHogConfig(
* Hook that allows for modification of the default mechanism for
* generating anonymous device id (which as of now is just random UUID v4)
*/
public var getDeviceId: ((UUID) -> UUID) = { it },
public var getAnonymousId: ((UUID) -> UUID) = { it },
) {
// fix me: https://stackoverflow.com/questions/53866865/leaking-this-in-constructor-warning-should-apply-to-final-classes-as-well-as
@PostHogInternal
Expand Down

0 comments on commit 641aa01

Please sign in to comment.