react-native-iap
react-native-iap copied to clipboard
getProducts using Amazon appstore return [Error: Error not specified.]
Description
Hi. In the latest versions of the library, when using Amazon, it doesn't work. I'm using hooks with useIAP
and I also have the App.js
file with the withIAPContext()
wrapper. I also have the RNIapActivityListener.registerActivity(this);
listener in the MainActivity.java
file.
It connects successfully (the value of connected
is true), but when I try to fetch the products using getProducts()
, nothing happens, and after a while, it throws the error [Error: Error not specified.]
. However, it works correctly on Google Play and iOS, and I'm able to make purchases.
Thank you.
Expected Behavior
The "getProducts" function should return the defined products.
Environment:
- react-native-iap: 12.10.7
- react-native: 0.72.3
- Platforms: Android
To Reproduce
Using the library normally within the Amazon environment and attempting to retrieve the products defined in the SKUs.
Additional Context
Example code:
const {
connected,
products,
availablePurchases,
currentPurchase,
currentPurchaseError,
finishTransaction,
getProducts,
getAvailablePurchases,
} = useIAP();
useEffect(() => {
console.log(connected);
if(connected) getProducts({ skus: iapSkus })
}, [connected])
useEffect(() => {
console.log(products);
}, [products])
This is also happening to me either for getProducts as for getSubscription
Already set up correctly Amazon App Tester, imported the amazon.sdktester.json
from the exampleApp
but still getting the error
Same issue here