Hello Team,
I am trying to purchase product on android React native. I double check each and everything.
1. In-App product all product status is active.
2. In revenue cat product's status code is OK.
3. In revenue I created offering..
4. I also checked both play store and revenue cat product ID is matched
I am using code
//
const onPurchased = async (item: PurchasesPackage) => {
try {
setIsProcessing(true);
const purchaseMade = await Purchases.purchasePackage(item);
console.log(JSON.stringify(purchaseMade), 'purchaseMade');
if (
'Monthly' ||
'Yearly' in (purchaseMade?.customerInfo?.entitlements?.active || {})
) {
Purchases.setAttributes(obj);
Purchases.setEmail(user?.email);
Purchases.setDisplayName(user?.username);
dispatch(getUserDetail());
setIsProcessing(false);
}
} catch (e) {
setIsProcessing(false);
console.log(e);
const error = e as PurchasesError;
if (error) {
Alert.alert('Failed', getErrorMessage(error));
}
}
};
please give me solution ASAP