Solved

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

  • 30 July 2021
  • 9 replies
  • 6347 views

Badge +6

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

9 replies

Userlevel 5
Badge +9

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 +6

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 +6

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 5
Badge +9

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.

Badge +4

I am getting this error when trying to get current offers for an Amazon Kindle device.  

I am using the Amazon Tester App and have added the JSON file for the IAP to the tester app.  Anyone else try using RevenueCat for an Amazon app yet.

Userlevel 5
Badge +9

@Glen B. Can you create a new question for this? Since the original question was on Google Play, the cause for your issue is likely different. Mention me with @sharif and I’ll take a look. Also, in your new question, try sharing some debug logs - the Amazon Store is a new platform we just started supporting so debug logs would really help here.

Badge +1

FYI If you’re having trouble with the error posted be sure to also print out the entire error object. I just had this code in a try/catch that logged out the error, but there was more to the message. Use `JSON.stringify(e)` or something like that to get the full contents of the message.

Badge +2

I am having the same error in production. Not sure how to fix it? Seems to native to RevenueCat.

Have stack trace but it does not say much:

```

Error: The device or user is not allowed to make the purchase. at promiseMethodWrapper (address at index.android.bundle:1:178819) at anonymous (address at index.android.bundle:1:2760221) at call (native) at step (address at index.android.bundle:1:2757944) at anonymous (address at index.android.bundle:1:2757055) at fulfilled (address at index.android.bundle:1:2756679) at tryCallOne (/root/react-native/ReactAndroid/hermes-engine/.cxx/MinSizeRel/3ay5r3t4/x86_64/lib/InternalBytecode/InternalBytecode.js:53:16) at anonymous (/root/react-native/ReactAndroid/hermes-engine/.cxx/MinSizeRel/3ay5r3t4/x86_64/lib/InternalBytecode/InternalBytecode.js:139:27) at apply (native) at anonymous (address at index.android.bundle:1:198059) at _callTimer (address at index.android.bundle:1:197056) at _callReactNativeMicrotasksPass (address at index.android.bundle:1:197220) at callReactNativeMicrotasks (address at index.android.bundle:1:199136) at __callReactNativeMicrotasks (address at index.android.bundle:1:182508) at anonymous (address at index.android.bundle:1:181650) at __guard (address at index.android.bundle:1:182385) at flushedQueue (address at index.android.bundle:1:181561) at invokeCallbackAndReturnFlushedQueue (address at index.android.bundle:1:181504)```

Hello 

I encountered a similar issue where I received the message "The device or user is not allowed to make the purchase." I faced difficulty in retrieving the available offers. However, I managed to resolve the problem using the following steps:

1. Upload your Android app to the Play Store under the "Internal Test" category.
2. Add your email address as a tester for the app.
3. On your emulator or physical device, log in to the Play Store using the email address you added as a tester.
4. Rebuild the app.
   
Following these steps should help you overcome the problem and successfully retrieve the offers.

 

Reply