Skip to main content
Question

How does restore purchase work?

  • October 19, 2024
  • 1 reply
  • 255 views

Forum|alt.badge.img

I’m trying to implement Restore purchase for my first app using RevenueCat for Apple device. Want to understand how Restore Purchase work in RevenueCat 

  • When we call restore purchase, Does it check based on Apple account ID associated with that device / sandbox environment, or does it check based on the App User ID that we set for that session when initializing RevenueCat SDK?
  • My paywall appears only after user has logged in if there is not any active subscription for that user, so RevenueCat SDK is always initialized with a valid App User ID. Let say a user login with email a@mail.com, make a subscription, then logout. He then sign up with a new email and log back in with email b@mail.com on the same device that uses the same Apple account ID. Would my understanding be correct that:
    • He will see a paywall when logging back in with b@mail.com , since he is now being identified with a different App User ID which RevenueCat has not associated with any subscription yet
    • If user clicks on Restore purchase, the customer info object returned by `Purchases.restorePurchases()` would show that there is an active subscription (since Apple account ID is the same)
    • I can then implement the correct logic flow to disable the paywall accordingly
This post has been closed for comments

1 reply

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 383 replies
  • October 23, 2024

We have a full doc on restoring purchases here: https://www.revenuecat.com/docs/getting-started/restoring-purchases

 

  • When we call restore purchase, Does it check based on Apple account ID associated with that device / sandbox environment, or does it check based on the App User ID that we set for that session when initializing RevenueCat SDK?

restorePurchases checks the underlying Apple ID, which allows us to transfer the purchase to a different RC App User ID if necessary
 

Would my understanding be correct that:

  • He will see a paywall when logging back in with b@mail.com , since he is now being identified with a different App User ID which RevenueCat has not associated with any subscription yet
  • If user clicks on Restore purchase, the customer info object returned by `Purchases.restorePurchases()` would show that there is an active subscription (since Apple account ID is the same)
  • I can then implement the correct logic flow to disable the paywall accordingly

Exactly!


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