Skip to main content
Question

How to get in the App what the Customer has purchased ?


Forum|alt.badge.img

Hello to all

By the 

try {
CustomerInfo customerInfo = await Purchases.getCustomerInfo();
// access latest customerInfo
} on PlatformException catch (e) {
// Error fetching customer info
}

How is it possible to get which products that the customer purchased ? In my case, I have 2 consomables that are 10 and 50 games, I want to know which one that the customer purchased and in this case,,treat this information as a variable.

Thanks for your help

Vincent 

This post has been closed for comments

2 replies

Forum|alt.badge.img

Maybe my question was unclear, so let me reformulate it again:

 

I need to code in flutter Android and IOS by further

: The product and the date that the customer has last purchased. 

I am sure that for a lot of you it is simple but for me it is complicated.
Thanks a lot for your help

Regards and thanks


alejandra-wetsch
RevenueCat Staff
Forum|alt.badge.img+5

Hey ​@VincentFrance
 

Thank you for reaching out. I'll be happy to help! 


Just for extra context, you can find the CustomerInfo object and EntitlementInfo object references here. Below are code snippets showing how to get the information needed in Flutter. 

Product purchased

1final productIdentifier = customerInfo.entitlements.active["your_entitlement_identifier"].productIdentifier

Latest purchase date

1final purchaseDate = customerInfo?.entitlements.active["your_entitlement_identifier"]?.latestPurchaseDate

I hope this helps! Please let me know if you have any questions.
Best, 


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