Hey RC folks! 👋🏻
I’m trying to determine after a purchase is made whether or not the purchase was a trial or not. I’m using `try await Purchases.shared.purchase(product: storeProduct)` to make the purchase.
My initial solution was to iterate through the active entitlements i.e `results.customerInfo.entitlements.active` and try to see if there was a trial, but I was wondering if there’s a more elegant way to do so?
Thanks in advance!
Checking if a purchase is a trial
+2
Hi, the way you are iterating through the customerInfo for the type trial is one way to do this. Another way can be to use our webhooks and listen for an initial_purchase/renewal event and check if the period_type is trial.
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.