Klik Kliković
Klik Kliković

Reputation: 384

Google Billing Free Trial - same user multiple times

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.

Upvotes: 7

Views: 4621

Answers (4)

Jiwoks
Jiwoks

Reputation: 559

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

Upvotes: 0

Poonam-1223
Poonam-1223

Reputation: 1

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

Upvotes: 0

Kallos Zsolty
Kallos Zsolty

Reputation: 251

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

Upvotes: 0

Klik Kliković
Klik Kliković

Reputation: 384

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).

Upvotes: 1

Related Questions