Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results in empty response for getProducts! #407

Closed
13arturbruno opened this issue Feb 21, 2019 · 13 comments
Closed

Results in empty response for getProducts! #407

13arturbruno opened this issue Feb 21, 2019 · 13 comments
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS

Comments

@13arturbruno
Copy link
Member

Version of react-native-iap

"react-native-iap": "^2.4.1",

Version of react-native

RN 0.53+

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

IOS

Expected behavior

I need to implement and test this functionality in an app that I'll need to upload to apple connect

Actual behavior

results in empty response for getProducts

Tested environment (Emulator? Real Device?)

both

Steps to reproduce the behavior

my app information:
captura de tela 2019-02-21 as 10 59 31

my product information:
captura de tela 2019-02-21 as 10 59 46

i try with this code :

const itemSkus = Platform.select({
  ios: [
    'br.com.ousesaber.innap.usuariopremium'
  ],
  android: [
    'br.com.ousesaber.innap.usuariopremium'
  ]
});
getItems = async() => {
    try {
      const products = await RNIap.getProducts(itemSkus);
      // const products = await RNIap.getSubscriptions(itemSkus);
      console.log('Products', products);
      this.setState({ productList: products });
    } catch (err) {
      console.warn(err.code, err.message);
    }
  }

output:

Products Array []

I've been having enough problems with this, can anyone help me?

@hyochan hyochan added 🙏 help wanted Extra attention is needed 📱 iOS Related to iOS labels Feb 21, 2019
@hyochan
Copy link
Member

hyochan commented Feb 21, 2019

@13arturbruno Have you checked the readme? If not, please try the steps there then come back.

@marcusrall
Copy link

Did you find out what could be happening?

@13arturbruno
Copy link
Member Author

My error has been solved! Just had pended on the agreements and tax.

@tmjordan
Copy link

Hi everyone, I have the same problem. I always get an empty array when calling getProducts

@tmjordan
Copy link

@hyochan @13arturbruno

@hyochan
Copy link
Member

hyochan commented Mar 14, 2019

Please check the readme I've referred above and agreements and tax.

@tmjordan
Copy link

@hyochan i have to put my bank account information, and have an active state on paid applications contracts? If yes i will do it later.
But even on android i also receive an empty array.

@hyochan
Copy link
Member

hyochan commented Mar 14, 2019

@tmjordan Android takes max 24hours to make it work if you've just uploaded purchase items.

@tmjordan
Copy link

Ok thank you very much man, i will wait and i will let you know :)

@tmjordan
Copy link

Hi @hyochan, i have succeed to make it work on iOS, but still nothing on android, still getting an empty array. To test I'm using an android emulator with google play. Not sur if it is related.

@dhamnesh
Copy link

dhamnesh commented Jun 26, 2019

I am facing the same issue, getting an empty array from the getProducts() method.

react-native-iap - 2.4.8 & react native version - 0.56.0.

It is working properly on native iOS with the same id.

How to resolve it?

@dani-z
Copy link

dani-z commented Aug 9, 2019

@hyochan I was using InAppUtils module and the products were coming just fine, so I guess all the setup in Apple connect is OK.
But when I use getProducts I'm getting an empty array.

Using latest RN (0.60) and latest RNIap.

@emrecanozkok
Copy link

emrecanozkok commented Aug 12, 2020

@dani-z did you fix this problem.me too getting empty array
this is my simplest code

im added this products 12 hours ago and deployed alpha and beta channels (beta still waiting)

const itemSkus = Platform.select({
  ios: [],
  android: ['1_number_weekly', 'one_number_weekly', 'two_number_weekly'],
});

async componentDidMount() {
    try {
      await RNIap.initConnection();
      console.log(itemSkus);
      const products = await RNIap.getSubscriptions(itemSkus);
      this.setState({products});
      console.log('products', products);
    } catch (err) {
      console.warn(err); // standardized err.code and err.message available
    }
  }

console log is

[Wed Aug 12 2020 13:45:29.643]  LOG      ["1_number_weekly", "one_number_weekly", "two_number_weekly"]
[Wed Aug 12 2020 13:45:29.765]  LOG      products []

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 help wanted Extra attention is needed 📱 iOS Related to iOS
Projects
None yet
Development

No branches or pull requests

7 participants