I have a little problem. When I call fetchProducts to obtain the subscription product, an Error is prompted: "[RN-IAP] [fetchProducts] Failed: Error:" Unknown facebook::jni::JniException error.”
`
const {connected, subscriptions, getActiveSubscriptions, fetchProducts, requestPurchase, finishTransaction} =
useIAP({
onPurchaseSuccess: async (purchase) => {
// Validate on your server, then finish
// await finishTransaction({purchase});
},
onPurchaseError: (error) => {
// if (error.code !== ErrorCode.UserCancelled) {
// Alert.alert('Error', error.message);
// }
},
});
const getPriceStepList = async () => {
const payId = 'id'
console.log('intiBlb subs', payId, connected)
try {
await fetchProducts({skus: [payId], type: 'subs'});
const data = await getActiveSubscriptions();
console.log('data', data)
console.log(data);
} catch (error) {
Alert.alert('Error');
console.log(error);
}
}
useEffect(() => {
if (connected) {
getPriceStepList()
}
}, [connected]);
`
- "react-native": "0.79.2",
- "react-native-iap": "^14.7.20",
- "react-native-nitro-modules": "^0.35.3",
I have a little problem. When I call fetchProducts to obtain the subscription product, an Error is prompted: "[RN-IAP] [fetchProducts] Failed: Error:" Unknown facebook::jni::JniException error.”
`
const {connected, subscriptions, getActiveSubscriptions, fetchProducts, requestPurchase, finishTransaction} =
useIAP({
onPurchaseSuccess: async (purchase) => {
// Validate on your server, then finish
// await finishTransaction({purchase});
},
onPurchaseError: (error) => {
// if (error.code !== ErrorCode.UserCancelled) {
// Alert.alert('Error', error.message);
// }
},
});
const getPriceStepList = async () => {
const payId = 'id'
console.log('intiBlb subs', payId, connected)
try {
await fetchProducts({skus: [payId], type: 'subs'});
const data = await getActiveSubscriptions();
console.log('data', data)
console.log(data);
} catch (error) {
Alert.alert('Error');
console.log(error);
}
}
useEffect(() => {
if (connected) {
getPriceStepList()
}
}, [connected]);
`