-
-
Notifications
You must be signed in to change notification settings - Fork 689
Description
Hi,
Looking for help
I am using:
"react-native": "0.81.1",
"react-native-iap": "^14.5.0",
"react-native-nitro-modules": "^0.31.10"
node: 20.19.6
and Java 17
I am simply installing the react-native-iap and react native nitro modules and using the setup in the recent documentation. This works totally fine in ios. However, it isn't working on android (both emulator and physical device) and i cannot connect to the play store to get purchases/subscriptions. I'm getting this specific error.
[react-native-iap]: PurchaseError
Nitro runtime not installed yet. Ensure react-native-nitro-modules is initialized before calling IAP.
I initialise react-native-iap as in the docs very much like this:
const {connected, products, subscriptions, fetchProducts, requestPurchase} =
useIAP({
onPurchaseSuccess: (purchase) => {
console.log('Purchase successful:', purchase);
handleSuccessfulPurchase(purchase);
},
onPurchaseError: (error) => {
console.error('Purchase failed:', error);
handlePurchaseError(error);
},
});
Then i fetch products. I have left the native android files - i.e, I have briefly tried to initalise react-native-nitro-modules in the MainApplication.kt file - but removed it - as it wasn't helping. I also tried importing react-native-nitro-modules in the index.js file of my react-native project - but removed as it didn't help. Is there something I am doing wrong? Help would be appreciated.