Skip to main content
Solved

How to know action triggers the addCustomerInfoUpdateListener

  • January 31, 2023
  • 1 reply
  • 124 views

Forum|alt.badge.img+3

This method will fire whenever the SDK receives an updated CustomerInfo object from calls to getCustomerInfo(), purchase(package:), purchase(product:), or restorePurchases().

 

Is there a way to tell what causes the method passed to addCustomerInfoUpdateListener to be called?  It will be nice to be able to tell the difference between a purchase and restore when it fires.

Best answer by cody

Hey @devTNT!

Unfortunately not at this time - the method will be fired when any changes are received for the cached CustomerInfo object. As a workaround, you may be able to store a value somewhere in your app when a user attempts a purchase vs. a restore so you know the last ‘action’ before the listener was fired.

View original
Did this post help you find an answer to your question?

1 reply

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 497 replies
  • Answer
  • February 2, 2023

Hey @devTNT!

Unfortunately not at this time - the method will be fired when any changes are received for the cached CustomerInfo object. As a workaround, you may be able to store a value somewhere in your app when a user attempts a purchase vs. a restore so you know the last ‘action’ before the listener was fired.


Reply


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