Skip to main content
Question

addCustomerInfoUpdateListener doesn't trigger when I call login method to update the user id

  • January 23, 2024
  • 1 reply
  • 248 views

Forum|alt.badge.img+1

Hello, I’m using RevenueCat in my Flutter-based application. In my app, there is an authentication (login/register) system. To reference the user, I call Purchases.login('backend_app_user_id') whenever a user logs in or registers, so it updates the user ID.

I’m also using Purchases.addCustomerInfoUpdateListener to listen to changes in CustomerInfo. I call this function once at the launch of the application, and later it automatically recalls itself whenever some changes happen in the CustomerInfo. That’s how it is supposed to work, right?

However, the problem is that whenever I call the Purchases.login method, which basically updates the user ID and CustomerInfo object, Purchases.addCustomerInfoUpdateListener doesn’t respond to this change. It doesn’t fire the addCustomerInfoUpdateListener whenever I call the login method.

This post has been closed for comments

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • January 25, 2024

Hi,

Happy to help here. The “add” method itself won’t be called, but the listener will instead update the object. If you use the getCustomerInfo method after login, do you see the latest information?


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