Skip to main content
Solved

How to handle purchases.

  • August 21, 2024
  • 1 reply
  • 51 views

Forum|alt.badge.img+2

Hi,

I’m currently using PaywallActivityLauncher to display the paywall in my Android application. I need to manage both the purchase state and the restoration of previous purchases. While I’ve come across methods to handle the purchase state, I haven’t found any options for managing the restoration of state.

Could you provide guidance on how to handle restoring the state of purchases with PaywallActivityLauncher

when user click the restore button.override fun onActivityResult(result: PaywallResult) {    when(result){        PaywallResult.Cancelled ->            Log.d("revenuecat ","Cancelled")        is PaywallResult.Error ->            Log.d("revenuecat ","Error")        is PaywallResult.Purchased ->            Log.d("revenuecat ","Purchased")    }}

 

Thank you!

Best answer by Ryan Glanz

Hi, I mentioned this in an email to you, but can post here as well: 

We don't have a way to add custom listeners to the Paywalls components just yet, but we do have this customerInfo listener that will fire whenever the customerInfo object updates (e.g., when restorePurchases is clicked and it modifies the object if there's a missing purchase). Would that work for your use case?

View original
Did this post help you find an answer to your question?
This post has been closed for comments

1 reply

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 384 replies
  • Answer
  • August 23, 2024

Hi, I mentioned this in an email to you, but can post here as well: 

We don't have a way to add custom listeners to the Paywalls components just yet, but we do have this customerInfo listener that will fire whenever the customerInfo object updates (e.g., when restorePurchases is clicked and it modifies the object if there's a missing purchase). Would that work for your use case?


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