How to check user already used FREE Trial In-App Subscription

Viewed 547

I am creating an app in which i need to update UI based on Google Play Subscriptions

I have two cases in which i have problem

  1. is user used Free Trial Subscription
  2. Is user used Introductory based Subscription or not

I know it will automatic adjust when user try to payment. But I need this in to update App UI

2 Answers

Google doesn't provide an API for this.

First option: If you're forcing users to sign in, then you can use Firebase RTDB to save the user's subscription/trail data and then you can listen to DB changes and update the UI on data changes.

Second one: You can use a service to track this data like Revenuecat. You can check Period Type from their API. I'm currently using it and it does the job.

Other than that, there's no way to get this information from Google yet.

Currently, I don't think there is a way to get the details of free trial subscriptions as per google play API. So as per your use cases, we can make a workaround it.

We can use purchases.subscriptions.get to get the timestamp when the subscription was taken and once that information is with us we can compare the subscription taken the time and we can compare it with the current time. If that time exceeds the Trial days limit we will know that its a Introductory based Subscription.

Related