Skip to main content

 

I always have a known user ID before I get to my paywall, so do I ever need to use Purchases.logIn() ?

If I sign out, I don’t call Purchases.logOut() because I don’t want to generate an anonymous ID, but when I get another user coming through and hitting the paywall, is it sufficient just to call Purchases.configure() again integrating the new appUserId?

I’m just concerned that I’m using a ‘configure’ function for setting the apiKey which should only really be done once per session but I’m doing that every time I sign in a new user when it seems more sensible to use a logIn function.

Are there any downsides (apart from a wasted resetting of the apiKey) with the way I’m doing this?

I mean, it seems to be working…..

Many thanks.

Hi, you do not want to call configure() more than once as you only want one instance of the Purchases SDK and calling it more than once can cause unwanted behavior. You will instead want to use logIn() if a different user will be using the app in the same session and you do not need to call logOut() when switching users as logIn() is sufficient. Please see our guide here on how to configure with only custom ids for more details on this: https://www.revenuecat.com/docs/user-ids#how-to-only-use-custom-app-user-ids

 

 


Many thanks for the clarification, Haley.
 


Reply