Solved

Getting "The device or user is not allowed to make the purchase."

  • 30 July 2021
  • 4 replies
  • 90 views

Badge

I realize this is similar to the post here, but was hoping to dig into it a bit more on why we are seeing this failure.

We are seeing “The device or user is not allowed to make the purchase.” when attempting to call Purchases.getProducts() or Purchases.getOfferings() from our React Native app.  A few notes:

  • We’re on React Native 0.63.  (I realize that the docs recommend 0.64 or newer, but it was my understanding that it should still work on this version).
  • We’ve ensured that the emulator we are running has the Google Play Services SDK installed.  According to the AVD Manager, we’re using a fairly new Android version: Android 11.0 (Google Play Services)
  • We are logged into an account on the emulator that is registered as a license tester on the Google Play Console.
  • The emulator has been rebooted several times.

This error happens in both our main app and a simple test app that we put together for the sake of testing.  Is there something else that we are missing in our testing process that could be causing this?
 

icon

Best answer by Sean Ouimet 6 August 2021, 22:55

View original

4 replies

Userlevel 3
Badge +8

Usually this kind of error is due to some kind of glitch in the emulator - do you have a device you could test on? They tend to be way more reliable.

Can you also try wiping the emulator and doing a fresh install?

I’m not a React Native expert but it is a good idea to use as new of a version as possible of React Native and the RevenueCat SDK because this specific error can be caused by a mismatch in Billing Library and other dependencies. Specifically, version 4.3.0 uses Billing Client 4 and version 3.0.0 uses Billing Client 2.

Badge

Very interesting.  In testing with an actual physical device, we don’t get the same error.  But testing in the emulator, we do still get it.  That’s a bit of a head scratcher.

When testing with an actual physical device, when calling `Purchases.getOfferings();` it’s returning no results.  (E.g.: it returns `{"all": {}, "current": null}`).  We’ve followed this document, and have verified the following:

  • The Product identifier in RevenueCat matches the Play Store.
  • The Android package name in AndroidManifest.xml matches what it is on the Play Store.
  • The app is published on a closed testing track, and the account logged in to on the physical device has been added as a tester to the app.  (Originally this wasn’t the case, but it seems to have made no difference).

We do have at least one offering configured in the play store, although it is currently marked as inactive.  Does `getOfferings()` include inactive subscriptions in the results?

The iOS version of the app seems to fetch subscriptions just fine, which makes me think it’s something relating to configuration for the app in the Google Play Console.  I’m at a loss of what it could be, though.  Does the app version running on the local physical device have to match the release version on the closed testing track?  I thought from my reading about license testing, it shouldn’t matter - as long as a version of the app is on a testing track.

Badge

We were able to confirm that a subscription must be marked as Active in order to get returned by getOfferings().  In our case, it took a while (minutes, possibly longer) after marking it as Active in the Google Play Console before the app was able to pick up on it.

Userlevel 3
Badge +8

Thanks for sharing what worked for you! I added your tip on marking the subscription as active in the troubleshooting guide you linked: 

It needed a little TLC as well - you’ll find the Android-related tips under the Android section.

Reply