Skip to main content
Solved

Is it safe to call login() with a different id?

  • December 10, 2024
  • 1 reply
  • 13 views

mariusbolik
Forum|alt.badge.img+5

We recently changed our auth provider and our users now have different IDs. Is it okay to call `login()` again with another user id and call `syncPurchases()` afterwards, grant the user acces to his purchses again? Or should I set an alias?

 

Kind regards,
Marius

Best answer by joan-cardona

Hi ​@mariusbolik,

Be aware of the different ways to transfer purchases between users, it’s worth reading this guide.

If you call logIn() it will create a new user rather than creating an alias (check here for all the different options). Depending on what transfer behavior you have it’ll work one way or another. The default behavior should be enough to have everything working but I’d check first in sandbox that everything works as you expect!

Best,

View original
Did this post help you find an answer to your question?
This post has been closed for comments

1 reply

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 441 replies
  • Answer
  • December 12, 2024

Hi ​@mariusbolik,

Be aware of the different ways to transfer purchases between users, it’s worth reading this guide.

If you call logIn() it will create a new user rather than creating an alias (check here for all the different options). Depending on what transfer behavior you have it’ll work one way or another. The default behavior should be enough to have everything working but I’d check first in sandbox that everything works as you expect!

Best,


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings