promotedai / ios-metrics-sdk

iOS client library for Promoted.ai metrics tracking.
MIT License
7 stars 1 forks source link

Allow clients to set `userID` without logging a user event #129

Closed yunapotamus closed 6 months ago

yunapotamus commented 3 years ago

Right now, setting the user ID requires a call to startSessionAndLogUser(userID:), which also sets the logUserID and logs a User event. Proposal is to allow the following:

  1. Allow the user to set userID and logUserID at the same time. If the user sets userID then we force them to also set logUserID. This is because we don't want to let the two get out of sync.
  2. Allow the user to set only logUserID, which would then clear any userID already set.

Sign off

Work begins when sign-off is received from all of the following:

jinyius commented 3 years ago

would like to verify that hipcamp would be able to satisfy 1 b/c they have the user id and anonymous user id (luid stand-in) and snackpass relies on us for user auth event logging so would fall into the unspecified 3rd option which is we do the user event logging.

i'm trying to figure out 2 a bit more. why would the userId be set alone w/o luid? when would this happen if 1 is true?

yunapotamus commented 3 years ago

would like to verify that hipcamp would be able to satisfy 1 b/c they have the user id and anonymous user id (luid stand-in)

Yes, in theory. In practice, we are only sending the anonymous user ID.

and snackpass relies on us for user auth event logging so would fall into the unspecified 3rd option which is we do the user event logging.

We do the user event logging for Snackpass.

i'm trying to figure out 2 a bit more. why would the userId be set alone w/o luid? when would this happen if 1 is true?

userID would not be set by itself. If you set logUserID by itself, then any existing userID would be set to nil.