Google play Subscriptions Free trial
Asked Answered
F

1

28

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

Fullrigged answered 28/12, 2017 at 13:34 Comment(7)
Did you have any luck in testing this? I'm also trying to implement your same requirements.Bandurria
@DamienDiehl yes, it seems you receive "freeTrialPeriod":"P1W" regardless of it's availability for user. So you need to manage it manually. However when you do mSubHelper.launchPurchaseFlow(...), user will see if their trial period has expired in GooglePlay's popup, like this prntscr.com/j49fyqFullrigged
Yeah this is tricky, I'm finding that queryPurchases will not even necessarily return all previous purchases for a SKU, so we can't rely on that to determine if there is a free trial available. I'm still searching for solutions but I don't think there will be anything reliable :(Bandurria
@DamienDiehl seems all you can do is save trial status after successful purchase. If you can identify user through your server, you may store the status there. Otherwise just store it localy and in case of reinstallation user will see "free trial" in the app and real status in GP popup. Also you may try to identify user by email (https://mcmap.net/q/11118/-how-to-get-the-android-device-39-s-primary-e-mail-address) but you need special permissions to do so, I don't think it's worth it :(Fullrigged
Check my answer https://mcmap.net/q/504893/-detecting-whether-the-current-subscription-is-in-trial-for-google-play-storeMalversation
Has anyone tried using BillingClient.queryPurchaseHistoryAsync() for this? It should tell you if the user has ever purchased any subscriptions.Barnaby
any answer to this question?Disposal
F
3

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)

Fowlkes answered 3/1, 2021 at 12:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.