Skip to main content
Answer

How to know action triggers the addCustomerInfoUpdateListener

  • January 31, 2023
  • 1 reply
  • 163 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.

This post has been closed for comments

1 reply

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 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.