Skip to main content
Question

Logging in with Purchase SDK on Flutter - do I need to do it every time?

  • November 21, 2024
  • 1 reply
  • 21 views

Forum|alt.badge.img+2

So, this is the workflow for me - on app start I initialise Purchase sdk with anonymous user:

Purchases.configure(configuration);

Upon successful login, I login - 

Purchases.logIn(credentials.user.sub);

The question is (and I couldn't find it in the docs) - on app restart, will subsequent

Purchases.configure(configuration);

overwrite legit user back to anonymous ?

User session is long lived, so there will be no login flow on app restart, and I'm wondering will .configure(configuration) respect existing user id (considering logout wasn't called)? 

This post has been closed for comments

1 reply

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • November 25, 2024

Hi ​@ydolzhenko ,

No it’s not needed anymore unless you do a logOut(). It looks like your flow is more than enough to identify a user, you’ll have the anonymous alias that’s first created and then the custom app user id that you are giving it on the login.

Let me know if you have questions!


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