Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google play Subscriptions Free trial

Is there any way how to check if user've already used his free trial?

When I query sub I got the next data:

[
    SkuDetails:{
        "productId":"...",
        "type":"subs",
        "price":"...",
        "price_amount_micros":0000,
        "price_currency_code":"USD",
        "subscriptionPeriod":"P1M",
        "freeTrialPeriod":"P1W1D",
        "title":"...",
        "description":"..."
    }
]

Will this field "freeTrialPeriod":"P1W1D" disappear when a user uses his free trial? Or maybe there's some other way to know it?

I need to show "free" instead of subscription price and then show actual price after user used his free trial

like image 841
Oleksandra Avatar asked Dec 28 '17 13:12

Oleksandra


1 Answers

In the documentation, Google clearly emphasizes that this is Google Play responsibility to show the user that they have used the free trial.

Note: SkuDetails.getFreeTrialPeriod() returns the free trial period configured in Google Play Console. It's possible the user has already used a free trial. In this case, Google Play communicates to the user that they are ineligible for another free trial.

Free Trial Documentation

It means you can show the user (3 days free then price/time) always or you need to handle it manually (using shared preferences, your own server, using query purchase history async to keep shared presence status up to date in case of reinstalls)

like image 57
Eren Tüfekçi Avatar answered Nov 15 '22 13:11

Eren Tüfekçi