Solved

[Android] Identify package & trial eligibility on Google Play Store

  • 13 December 2022
  • 4 replies
  • 493 views

Badge +4

I have one simple entitlement/offer/product (package) definition for a yearly subscription with a 7-day trial period for new users who didn’t have any subscription before.

Now, I would like to get the user’s eligibility for the trial period directly from Google Play, but as far as I see it, this is currently not possible. So instead, I’m using 

CustomerInfo.allPurchasedSkus.isNotEmpty()

to check if a user is eligible for the trial period. If this check returns true (it’s not empty), then it means the user has bought a subscription before and therefor is not eligible for the trial period.

Unfortunately, this gives me mixed results - sometimes this check works correctly and sometimes not. So my question is, what’s a 100% bulletproof way of checking a user’s eligibility for a defined trial period?

icon

Best answer by cody 14 December 2022, 18:00

View original

4 replies

Badge +4

I did some more investigation and I found a user which does not have any purchased SKUs on RevenueCat, but DOES have purchased subscriptions on Google Play. It means that there is an inconsistency between RevenueCat’s data and Google Play’s data. I guess the reason is that the sandbox is a bit different than production.

But the remaining question is: It is possible to trigger a sync, so any (missed) purchase on Google Play will be transferred to RevenueCat?

Userlevel 6
Badge +8

Hey @Chris1,

You’ll need to first sync the user’s purchases with `syncPurchases` or `restorePurchases` - more info here:

 

Badge +4

Thank you @cody! That did it - I’m now calling syncPurchases as soon as my app is started, so all information is in place once I show the “purchase a subscription” screen. 

Badge +3

If you have an asynchronous call to get available offers, and you need to first syncPurchases before you can actually tell us which offers are available, why don’t you just do that inline when getting the offers?

All the SDK is doing right now is pushing that onto us and adding the additional hurdle of knowledge acquisition that this is even necessary. I should point out that when actually sending the purchase request to Google Play, it does the right thing -- it does not offer the trial if the user has already had a trial.

Why doesn’t the SDK automatically syncPurchases and apply the logic to the returned Offerings/SubscriptionOptions/etc? Why make every app that uses RevenueCat and wants to show “Try Free” on their call-to-action button implement the same stuff?

 

Reply