Skip to main content
Solved

Purchases.shared.restoreTransactions for products

  • 30 July 2021
  • 1 reply
  • 89 views

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?

1 reply

Userlevel 5
Badge +9

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.

Reply