Sku is not visible
Please use the Discussion board if you want to get some help. Please use issues to report bugs.
Description The SKUs are not working after initializing the connection in React Native IAP, and I am not getting the products (SKUs) in my list.
Environment:
- react-native-iap: "12.15.2",
- react-native:"0.69.3",
- Platforms (iOS, Android, emulator, simulator, device): IOS
This is my code
const initalizeIAP = async () => {
await initConnection();
purchaseUpdateSubscription = purchaseUpdatedListener(purchase => {
setLoading(true);
const receiptValue = purchase.transactionReceipt;
if (!isReceiptValidationRequestInProgress && !!receiptValue) {
setIsReceiptValidationRequestInProgress(true);
getUserSettings().then((userdata) => {
validatePurchaseIOS(receiptValue, userdata.uid).then((resp: any) => {
if (resp.status === 'Success') {
getUserSettings().then((userSettings) => {
setUser(userSettings.user);
//Finish transaction once the grant is successful i.e. paymentPackage field is other than 'free'
finishTransaction({
purchase: purchase,
isConsumable: false,
})
setIsReceiptValidationRequestInProgress(false);
})
}
else {
Alert.alert('Purchase receipt could not be validated')
}
}).catch((error) => {
console.log(error, 'error');
Alert.alert('Purchase receipt could not be validated')
setLoading(false);
}
)
})
setLoading(false);
}
});
purchaseErrorSubscription = purchaseErrorListener(
(error: PurchaseError) => {
setLoading(false)
},
);
}
// get iOS in-app purchase product list
const _getProducts = () => {
getProducts({
skus: [
'com.mmapp.smarteye.monthlyplan', 'com.mmapp.smarteye.yearlyplan'
],
});
};
+1
Check your App Store Connect to make sure the Business information is filled out. You need to confirm the agreements and complete bank and tax information. Products will not be available if the business information is not complete.
I also faced the same issue — the list temporarily disappears after finishTransaction is called
I’m closing all issues reported in versions below 14, as the library now supports the new architecture with NitroModules and has been completely revamped.