Question

[Android] [React Native] "The product is not available for purchase"

  • 27 February 2024
  • 1 reply
  • 37 views

Badge

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 


This post has been closed for comments

1 reply

Userlevel 4
Badge +6

Hey @pragnesh-fa84d0 !

 

This error is returned from the store itself and indicates that the product is not available for purchase by the device or user. This is usually not an error related to code, but to fix this we recommend that you ensure you're attempting to purchase a product that's available for the device / user that is attempting to make this purchase.