Skip to main content

I’m building frontend logic to either:

  1. Show eligible users an offer with a 3-day free trial (a promotional offer)
  2. Show ineligible users a paywall without the trial offer.

I know that  checkTrialOrIntroDiscountEligibility exists for ios. But there isn’t a similar function for android devices. 

So I’m trying to build a workaround with allPurchasedProductIdentifiers in the CustomerInfo object. 

 

My question:  I’m wondering if free trials and introductory offers are added to the allPurchasedProductIdentifiers array when the trial starts. If so, then I can simply check to see if the length of allPurchasedProductIdentifiers to determine which offer to display. 

If not, are free trials and introductory offers recorded somewhere else that I can check on android?

Hey ​@Chris Thornham,

Introductory offers or trials on products should be included in `allPurchasedProductIdentifiers`. Another way you can look at this is, if you have attached your products to entitlements, you can check `EntitlementInfos` with `isNotEmpty()`. If the Entitlements array is empty, the user has never had access to this entitlement through any product and is eligible for an intro offer. 

Otherwise, if you don’t user Entitlements, you can use `allPurchasedProductIdentifiers` as you said, or `allPurchaseDatesByProduct` would also work for you to check if the product has previously been purchased. 


Beautiful! Thank you ​@kaitlin 

These design patterns would be a nice addition to this section of the docs. 


Reply