Skip to main content
Answer

Purchases.shared.restoreTransactions for products

  • July 30, 2021
  • 1 reply
  • 115 views

Forum|alt.badge.img+2

Hey there!

 

I’m gonna to restore user’s purchases

and using this method “Purchases.shared.restoreTransactions { (purchaserInfo, error) in { }”

 

BUT! I’d like check the purchases by Identifier in which indicated in Products, when I address to “purchaserInfo”. How can I implement this?

Best answer by sharif

Hello!

It depends what you want to do, but if you want to check which products have been purchased:

  • purchaserInfo.activeSubscriptions is a set that contains any active subscriptions. You can look up subscriptions by product identifier.
  • purchaserInfo.nonSubscriptionTransactions is an array that contains all non-subscription products purchased (lifetime and consumable). You can loop through the array to see what products have been purchased and the dates they were purchased.

You can read our guide on getting the user’s information for more information on what’s returned in the purchaserInfo.

This post has been closed for comments

1 reply

sharif
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • Answer
  • July 30, 2021

Hello!

It depends what you want to do, but if you want to check which products have been purchased:

  • purchaserInfo.activeSubscriptions is a set that contains any active subscriptions. You can look up subscriptions by product identifier.
  • purchaserInfo.nonSubscriptionTransactions is an array that contains all non-subscription products purchased (lifetime and consumable). You can loop through the array to see what products have been purchased and the dates they were purchased.

You can read our guide on getting the user’s information for more information on what’s returned in the purchaserInfo.