We use the RevenueCat Purchases SDK for Kotlin, version 9.28.1, on our Android app.
In our use case, we want to set or update the user’s e-mail attribute on their RevenueCat profile as part of their logging in to our app. The e-mail is a piece of data that does help during customer support, so we want it to be stored reliably on RevenueCat.
We are aware that user attributes are not immediately synced to the RC backend for calls like setEmail(), and that attribute syncing actually happens implicitly as part of other, more significant, events (or with an explicit syncAttributesAndOfferingsIfNeeded() call.) With this in mind, we do these two calls, one right after the other:
Purchases.sharedInstance.setEmail(...)
Purchases.sharedInstance.logIn(...)We have browsed the SDK source code and it does look like logIn() is one of the calls for which attribute synchronization happens under the covers on the Kotlin SDK (even though that is not mentioned in the documentation), which might mean that we don’t need an additional explicit call to request syncing. Can you please confirm that is the case?
Now, we are wondering: If a user starts out with an anonymous ID and then logs in (for which we do setEmail() and logIn() as described above), which RevenueCat profile gets updated with the e-mail address? Is it the profile before the logIn(), the one after it, or both? We ask because we see the same e-mail address showing up on both anonymous and identified profiles. So, in practice, it looks like both are updated. As far as what we can gather from the SDK source code, it looks like it’s both, too.
Any input is appreciated.
