PostHog / posthog-android

PostHog Android SDK
https://posthog.com/docs/libraries/android
MIT License
43 stars 23 forks source link

add `isIdentified` property and check on `identify()` #157

Closed beradeep closed 2 months ago

beradeep commented 2 months ago

:bulb: Motivation and Context

This change adds the is_identified property (absent earlier) to check user is identified or not (anonymous). This change also adds a fix to identify() to ensure that an "identify" event is captured if and only if the user isn't already identified (anonymous).

fix #136 & #108

:green_heart: How did you test it?

:pencil: Checklist

marandaneto commented 2 months ago

@beradeep would you pick up this PR again? just so I don't get to it as well, thanks.

beradeep commented 2 months ago

Yes, I'll pick it up. I think I should go with the solution you provided in a7bf27a.

beradeep commented 2 months ago

When should I turn isIdentifiedLoaded back to false? Inside PostHog.endSession()?

beradeep commented 2 months ago

@marandaneto Sorry, I closed this PR accidentally. I've created a new one #167.