How to find out if the user is eligible for Free Trial with Billing Library (in other words, he had not availed Free Trial before)?
Asked Answered
M

1

14

How to find out if the user is eligible for Free Trial with Billing Library? In other words, how to find out that the user had not availed Free Trial before? I didn't find any API that would help to know this for sure. And this information is not associated with the application account, but is rather related to the user's Google Play account. The user can create a new account in the application, but if he has already participated in the Free Trial, i.e. he before bought the subscription with Free Trial with his current Google account (in Google Play), he will see a message in the popup from Google "You've already participated in the free trial". The user can also change his google account in Google Play at any time. Therefore, storing the information that user already purchased the subscription on the server will not help. And I need to display this information on the app UI.

Marrowfat answered 18/5, 2022 at 10:36 Comment(1)
did you find any solution?Willmert
I
9

When you're querying for subscription data, you'll receive a list of ProductDetails. It will be a mix of base plans and offers. If user is eligible for free trial offer - corresponding item will be present, if not (e.g. if it has been used earlier) - free trial won't be present.

To distinct between different base plans and their offers, I personally use tags. You can add them in console and then filter through the list of ProductDetails by that tag.

E.g.

const val MONTHLY_BASE_PLAN = "monthly-base-plan"
const val MONTHLY_FREE_TRIAL_OFFER = "monthly-ft-offer"
const val YEARLY_BASE_PLAN = "yearly-base-plan"
const val YEARLY_FREE_TRIAL_OFFER = "yearly-ft-offer"
Interlocutress answered 9/8, 2022 at 15:17 Comment(5)
Did you test that on a released app?Oblation
Yes. Just checked it out once more. For new user free trial is present, for the one who already tried free trial - only base plan is available.Interlocutress
thanks! now easier to sell it to PM :)Oblation
How do I give myself back my free-trial eligibility for testing purposes?Feudalism
Do you know if it's safe to add a tag to an old backward-compatible product?Janssen

© 2022 - 2024 — McMap. All rights reserved.