Skip to main content

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?
 

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.


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.


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.


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.


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.


@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.


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.


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.

 


I am also seeing this now for the first time in production. The user’s device is an Android Samsung A14 (model SM-A146U).

Other Androids are not having this issue. 
 

"error": {
"userInfo": {
"code": 3,
"readableErrorCode": "PurchaseNotAllowedError",
"readable_error_code": "PurchaseNotAllowedError",
"underlyingErrorMessage": "Error updating purchases. DebugMessage: . ErrorCode: BILLING_UNAVAILABLE.",
"message": "The device or user is not allowed to make the purchase.",
"userCancelled": false
},
"code": "3",
"nativeStackAndroid": d],
"message": "The device or user is not allowed to make the purchase.",
"userCancelled": false
}

Is this something missing on the user’s device that I can ask about?

What troubleshooting steps should I take with the client?

Thanks in advance


@cube20ever20 If some Android users can make purchases and others can't, then the issue is probably on the user's device rather than in your app or in RevenueCat. It could be that the device or account isn't able to make subscription purchases or has issues related to parental controls, device settings, location, etc. That error comes straight from Google (RevenueCat is not involved in it) so basically Google is saying they can't complete the purchase because the device the user is using is not allowed to make the purchase. 

We have more info about the error here: https://www.revenuecat.com/docs/test-and-launch/errors#--purchase_not_allowed


Thank you @jeffrey_bunn for this info.
Do you happen to have any advice what I should ask the user about ? Or just tell them to try and figure it out with Google or their Play account?


Hi @cube20ever20, you can have them check their Google Play account to make sure that purchases are enabled, that parental controls aren’t limiting anything on the account, and that the device settings look good such as the device’s location matching that of their account. They should also make sure that their Google Play store and device are updated to the most recent versions.


Reply