Question

Entitlements randomly return empty causing unexpected subscription expiration


Badge +6

A growing number of our Android users are experiencing unexpected subscription expirations due to the PurchaserInfo.getEntitlements() returning empty incorrectly.  

The user will then use the restore functionally and PurchaserInfo.getEntitlements() will return correctly with their entitlements on the restore callback.  Within the the next couple sessions the user will get 0 entitlements returned again and be forced to restore once again. This behavior does not seem to stop and the users are stuck in this loop. 

 

Background information:

- Android
- Confirmed users own entitlements in rev cat dashboard
- RevCat Version: v3.3
- We call Purchases.getSharedInstance().getPurchaserInfo() to verify subscription on every session


11 replies

Userlevel 3
Badge +5

Hello @Shiv!

Would you be able to update to a newer version of the Android SDK and see if that solves the issues?

  • v3.3 was released July 29, 2020 and there have been a lot of changes since then
  • v5.0 was released 7 days ago but you could also try v4.6.1 was released December 14, 2021

This would be a great starting point to help with this problem if you could update 😊 

Thanks!

Badge +6

Hi @joshdholtz 

We are currently using SDK v4.6.1.  v3.3 is what it appears to be referred to in the documentation.

 

 

Userlevel 3
Badge +5

@Shiv Ahhh, the docs version is very confusing as it doesn’t really relate to all of the different SDK versions. We are working on ways to fix that 😊 

But anyway… glad to hear that you are on that 4.6.1! I have a few questions for you to see if we can narrow down some of the possibilities…

  1. Are you using the `login` method for your users? Or are you using the anonymous IDs that RevenueCat uses by default?
  2. Are you doing anything in your app to clear `SharedPreferences`?

Thanks!

Badge +6

@joshdholtz 

We are not using the login method nor anonymous IDs.  We assign the users Id when initializing the SDK.

Purchases.configure(this, Constants.REVENUE_API_KEY, getUserId());

We also never clear SharedPreferences.

Userlevel 3
Badge +5

@Shiv Thanks for the details!

Is there a chance that `getUserID()` could potentially return null? I can see this behavior happening if that return null. That would create a new anonymous user which then might reset the cache / which purchases are seen as made.. and then a restore would reassign those to the that user making it look like everything is working again.

Is something like that possible? If so, that would explain this behavior 🤔

Badge +6

Hi @joshdholtz

We will deploy a build that logs exactly what getUserId() is returning and passing into the SDK at initialization.  Will let you know what we find out. 

 Thanks!

Badge +6

@joshdholtz 

We just received our first log from a user experiencing this problem and looks like we are definitely passing in a user Id with our getUserId() function.  The log is however showing that ‘Purchase.configure(..)’ is sometimes being called multiple times in a row for some reason.  Could this be a reason why this is happening?

 

The log is also showing that on the next session after restore the entitlements return correctly and then all subsequent sessions have empty entitlements.  Could be something that is happening on that first session after restore?

Userlevel 3
Badge +5

Hey @Shiv!

The multiple calls to `Purchases.configure` does sound a bit suspicious 🤔 If all of those are getting called with a valid user ID then that is probably not the issue but it still might be something that you would want to address. 

I have a few questions about you for the restore if that’s okay 😊 

  1. Is the user manually calling restore or is your app automatically calling that?
  2. Do you know if these instances of empty entitlements are on the same Google account that originally purchased the product?

The reason I’m asking these is this behavior almost seems like the restore is happening on a device that doesn’t have the purchases in the receipt so its removing the entitlements that it found right after the Purchases configuration with an app user id. 

Thanks for working through this with me and hopefully we can figure this out soon for you!

Badge +6

Hi @joshdholtz 

​​​​​The ​users are manually calling restore and we have confirmed that the users are logged into the Google Play account that originally made the purchases.

Badge +6

@joshdholtz we need help.  

Our users are very upset since they are losing their “unlock everything” subscription/lifetime purchase and the problem continues to grow.  Is it possible for us to share the user ids with you so you can monitor what is being returned from the backend?

We just received a new case where the user stopped receiving one of their entitlements but the rest are all present.  Unfortunately the one not being returned is the “unlock everything” entitlement.  Just like the other cases the restore function returns all the entitlements but on the next session the “unlock everything” entitlement is missing.  Everything looks fine for this customer in the RevCat portal.

Thanks for working through this with us.  We really appreciate it. 

Userlevel 3
Badge +5

Hey @Shiv!

Sorry to hear about this! Do you mind opening up a support ticket through the “Account” → “Contact Us” on the RevenueCat dashboard? This will open up a ticket where we can share more non-public details like those user ids that you are talking about.

Thanks!

 

Reply