Google Billing Free Trial - same user multiple times
B

4

7

We are implementing Google Billing with server side validation.

One of the features that we have to support is "Free Trial". Single user is able to participate in "free trial" only once.

If he cancels the subscription, and then tries to buy same subscription again, there is a note note "You've already participated in the free trial" (which means that the user will not get his trial period. Instead, he must pay immediately). This scenario is perfect for production/live environment.

However, in testing environment (or development environment, especially development), where we do a lot of try-and-repeat steps (which means that we go through the subscription lifecycle with same google user multiple times), it is real pain in the ass. For every iteration we have to create new google user.

My question is:

1 - is there a way to reenable "free trial" for specific user (or all of them) in testing environment (testing environment = google play testing tracks).

or

2 - is there some other way to make our life easier.

Babysit answered 17/2, 2021 at 13:40 Comment(0)
B
1

Actually new-google-account approach does not work either.

Have found two possible approaches:

1 - change IMEI number of your phone. NOTE: this might be illegal in some countries, and it might damage your phone. I haven't tried this approach, but it works apparently.

2 - Create multiple subscriptions in your google play store. And use these subscriptions only in test environment. Also in subscription settings, set "Free trial limit: One per subscription". Now you will be able to use free trial once per subscription (10 subscriptions = 10 free trial periods).

Very ugly solutions (if they are solutions).

Babysit answered 21/2, 2021 at 20:44 Comment(0)
I
0

If you're using RevenueCat, you can query allPurchasedProductIdentifiers and check if the user was ever subscribed. If yes, a free trial should not be given

Imperception answered 19/2, 2022 at 19:17 Comment(0)
M
0

I found a way accidentally. All you need to do is create a free trial offer and in Eligibility criteria, select developer determined. This way you will always have free trial enabled in the subscription with the same google account no matter how many times you test. Hope this helps.

https://www.revenuecat.com/docs/subscription-guidance/subscription-offers/google-play-offers#eligibility-criteria

Mick answered 5/3 at 13:57 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Recitative
P
0

The Play Billing Lab application is what you are looking for. You can enable through the application the free trial test again.

  1. Install the application from Google play store: https://play.google.com/store/apps/details?id=com.google.android.apps.play.billingtestcompanion

  2. In Configuration Settings panel click add

  3. Select your country

  4. Check the test free trial or introduction offer checkbox

  5. Click Apply button

You should now see the trial again in your application, and you should also be able to order again the subscription with the free trial applied.

Trial test

Google's documentation about it: https://developer.android.com/google/play/billing/test#trial-offers

Pall answered 17/5 at 9:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.