Skip to main content

When a user first enters our app, they are setup as an anonymous user and get RevCat’s anonymous ID. This happens via using `Purchases.configure(revcat key)`. Later should they login with a named account from our system, we use `Purchases.shared.logIn(customID)` to update the RevCat user with our customer identifier. 

The issue is that after doing this and checking `Purchases.shared.customerInfo()` for the ID, the initial anonymous ID is returned rather than the custom ID supplied at login. 

Should the login method not change the user’s ID when checking their `customerInfo`? 

 

 

Hi ​@Scott! If the named account is new to RevenueCat (i.e., doesn’t already have an anonymous alias), we will alias the anonymous and identified users together and treat them as one user going forward. More information on this is available here. If you’ve enabled webhooks, all aliased IDs will be present in the aliases array.


Hi ​@jeffrey_bunn - Thanks for your response. I understand the alias process but I am asking about the ID that is returned by customerInfo. Will that not return the specific custom ID given after using the login method? I know from the alias that I can get back to the custom number if needed but I was expecting to directly see the customer ID I gave at login moments prior.

Thanks. 


@Scott CustomerInfo will return the original app user ID supplied, so if you configure the SDK without providing a custom app user ID (which is a common flow), the original ID will be the anonymous ID and will remain in customerInfo. The identified ID is considered an alias, and is present in webhooks and the API. 

Can you share your use case for wanting customerInfo to return the custom ID? I’m happy to share this with my SDK team - perhaps we can return the aliases array in the SDKs as well as webhooks/API.