Question

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

  • 23 January 2024
  • 1 reply
  • 83 views

Badge +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.


1 reply

Userlevel 3
Badge +8

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?

Reply