Skip to main content
Question

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

  • Nov 21, 2024 12:59 PM UTC
  • 1 reply
  • 388 views

Forum|alt.badge.img+3

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
  • Nov 25, 2024 1:21 PM UTC

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!