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() #167

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). Also adds an in-memory flag to check if the property is already loaded or not.

fix https://github.com/PostHog/posthog-android/issues/136 & https://github.com/PostHog/posthog-android/issues/108

:green_heart: How did you test it?

:pencil: Checklist

marandaneto commented 2 months ago

Thanks @beradeep I left a few comments, after addressing, we can merge it don't forget to add an entry to the changelog.

marandaneto commented 2 months ago

The flag $is_identified isn't being set though, so this issue can't be closed https://github.com/PostHog/posthog-android/issues/136

marandaneto commented 2 months ago

The flag $is_identified isn't being set though, so this issue can't be closed #136

i pushed 2 commits to fix this