React-native-iap: Error: That item is unavailable.

Created on 31 Jul 2019  ·  5Comments  ·  Source: dooboolab/react-native-iap

Version of react-native-iap

"react-native-iap": "3.0.2"

Version of react-native

  "react-native": "0.59.2"

Platforms you faced the error (IOS or Android or both?)

   Android

Expected behavior

popup Google play buy

Actual behavior

Error: That item is unavailable.

Tested environment (Emulator? Real Device?)

Real device

Steps to reproduce the behavior

     import RNIap, {
      Product,
      ProductPurchase,
      acknowledgePurchaseAndroid,
       purchaseUpdatedListener,
       purchaseErrorListener,
          PurchaseError,
         } from 'react-native-iap';
         const itemSkus = Platform.select({
             android: [
              'xxx',
               'xxx',
               'android.test.purchased',
                ]
          });

    const result = await RNIap.initConnection();
      RNIap.getProducts(itemSkus).then((products) => {
          this.setState({
              products
          });

      requestSubscription = async (sku) => {
        try {
          RNIap.requestSubscription(sku);
       } catch (err) {
        console.log(err.message);
          }
      }

When I try to buy my product I got that error, but when I use android.test.purchased it works

🙏 help wanted 🤖 android

Most helpful comment

Try it. Work for me:

"You need additionally add your testing account to another special list of accounts "Gmail accounts with testing access", you can find that on play account setting(not project!). On the page where you can see a list of your projects go to settings, and then on "Account details" page (scroll down, it's almost in the bottom of page) you will find the "Gmail accounts with testing access" list."

Set up application licensing
To set up application licensing, start by adding your list of tester's Gmail addresses in the Play Console.

  1. Go to your Play Console.
  2. Select Settings Settings > Account details.
  3. Under "License Testing," add your testers' Gmail addresses.
  4. At the top of the screen, select Save.

All 5 comments

Please go over my guide to resolve your issue.

Please feel free to reopen when you still have a problem.

I followed your guide, but this not working, I used a signed apk on a real device, but I'm still getting that error

Try it. Work for me:

"You need additionally add your testing account to another special list of accounts "Gmail accounts with testing access", you can find that on play account setting(not project!). On the page where you can see a list of your projects go to settings, and then on "Account details" page (scroll down, it's almost in the bottom of page) you will find the "Gmail accounts with testing access" list."

Set up application licensing
To set up application licensing, start by adding your list of tester's Gmail addresses in the Play Console.

  1. Go to your Play Console.
  2. Select Settings Settings > Account details.
  3. Under "License Testing," add your testers' Gmail addresses.
  4. At the top of the screen, select Save.

What worked for me (after all of the above points) was to set a version of the app to Alpha phase in the Google Play Console and then open the alpha testing link on the device that I test with. There I accepted the testing invitation and only after that I could actually buy the products in my app.

I tried all those workarounds mentioned here but still i get that weird error : ' The item that you were attempting to purchase could not be found'.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

coldfins picture coldfins  ·  3Comments

chetstone picture chetstone  ·  4Comments

jvandenaardweg picture jvandenaardweg  ·  4Comments

jvandenaardweg picture jvandenaardweg  ·  4Comments

sanilcgs picture sanilcgs  ·  3Comments