getProductsForSale wont return anything
skayka opened this issue · 2 comments
Hello good sirs.
I am trying to get products for sale on Android. Here's the code:
await Iaphub.init({
appId: '61e5ea5c3af34e1214bbb407',
apiKey: 'VIji2hHQiDqgeVYsqdQCUUwidk5jgA2h',
environment: 'production',
});
await Iaphub.setUserId(user.uid);
try {
var products = await Iaphub.getProductsForSale();
console.log('\x1b[36m%s\x1b[0m', products);
} catch (e) {
console.error(e);
}
I can see the api request and I see that it gets a 200 response with the data i need, but it is not getting assigned to products variable and i do not get any errorrs.
I configured sandbox(doublechecked), I am using a real device(doublechecked).
Can anyone help me out? I am stuck.
Hi @skayka,
It is probably the react-native-iap peer dependency that isn't installed correctly.
Can you double check you've installed the version 5.2.6 ?
I have the same problem only on Android and on iOS everything comes.
react-native-iap version is set to 5.2.6 but still doesn't work
the request passes and the method is called, but nothing is output to the console and no error comes
maybe on android you need to add permission?
I used Android SDK 31