Question

How to check if user is eligible for a free trial?

  • 18 March 2024
  • 2 replies
  • 119 views

Badge +3

Hi there!

I’m currently implementing the paywall for my game in Unity. If fetch all offerings via the SDK, and my idea now is to check if the user is eligible for the free trial i have configured on all my products, and make the paywall offer that accordingly.

How do I do this in Unity? I don’t find any documentation on it, I feel like I have to run it on different devices, look at the different JSONs the SDK receives, read through the source code, etc. Feels odd for this being such a common use-case.

My first idea was if I can check “StoreProduct” objects in the packages of an offer have an “IntroductoryPrice” set, and then offer a free trial. But maybe that one is always set, regardless of eligibility? The existence of the “CheckTrialOrIntroductoryPriceEligibility” method makes me think so. For Android, you write “If Google Play determines that a customer is not eligible for the offer, it will not show up in the subscriptionOptions of the StoreProduct in the SDK at all.” 

To sum up: I need to handle iOS and Android in different ways; for iOS run the method you provide on each product, and then use the information in IntroductoryPrice; for Android look through all SubscriptionOptions in the StoreProduct, and somehow figure out if its a trial from the nested object contained in this SubscriptionOption. Is this correct?

It’s one thing that I have to handle platform specifics, another that I only find hints here and there for what to look for. Sorry for venting my frustration, I’m just a couple of days into reading and understanding RevenueCat docs and the whole pitch of “No more juggling multiple platforms and normalizing data across app stores” and “Just a few lines of code” seems a bit misleading to me at this point.

Anyways, I hope to get some clarity around what the best approach here is. Thank you!


This post has been closed for comments

2 replies

Userlevel 3
Badge +5

Hi! I apologize for the frustration that this issue has caused for you. We are interested in having checkTrialOrIntroductoryEligibility work for Android as it does for iOS and I will raise your feedback on the issue internally. You are correct that using that method to check if a user is eligible for a free trial on iOS is the correct strategy for your app. And yes, you are also correct for Android that you will need to check the freePhase property in the SubscriptionOptions that are returned to see if they are eligible for a free trial.

Badge +3

Thank you for confirming this, @wes_clark! It’s really the combination of missing documentation (besides the doc comments in the code, which are helpful but only go so far), no ability to test in the editor, and no easy testing of free trial eligibility on a sandbox iOS device (because sandbox users have no receipt file before making a purchase? - another issue popping up that you could anticipate and tell me about) that make me constantly build the app for iOS, try to figure out what the SDK returns using log statements, try something else and rebuild, repeat…