"react-native-iap": "3.0.2"
"react-native": "0.59.2"
Android
popup Google play buy
Error: That item is unavailable.
Real device
import RNIap, {
Product,
ProductPurchase,
acknowledgePurchaseAndroid,
purchaseUpdatedListener,
purchaseErrorListener,
PurchaseError,
} from 'react-native-iap';
const itemSkus = Platform.select({
android: [
'xxx',
'xxx',
'android.test.purchased',
]
});
const result = await RNIap.initConnection();
RNIap.getProducts(itemSkus).then((products) => {
this.setState({
products
});
requestSubscription = async (sku) => {
try {
RNIap.requestSubscription(sku);
} catch (err) {
console.log(err.message);
}
}
When I try to buy my product I got that error, but when I use android.test.purchased it works
Please go over my guide to resolve your issue.
Please feel free to reopen when you still have a problem.
I followed your guide, but this not working, I used a signed apk on a real device, but I'm still getting that error
Try it. Work for me:
"You need additionally add your testing account to another special list of accounts "Gmail accounts with testing access", you can find that on play account setting(not project!). On the page where you can see a list of your projects go to settings, and then on "Account details" page (scroll down, it's almost in the bottom of page) you will find the "Gmail accounts with testing access" list."
Set up application licensing
To set up application licensing, start by adding your list of tester's Gmail addresses in the Play Console.
What worked for me (after all of the above points) was to set a version of the app to Alpha phase in the Google Play Console and then open the alpha testing link on the device that I test with. There I accepted the testing invitation and only after that I could actually buy the products in my app.
I tried all those workarounds mentioned here but still i get that weird error : ' The item that you were attempting to purchase could not be found'.
Most helpful comment
Try it. Work for me:
"You need additionally add your testing account to another special list of accounts "Gmail accounts with testing access", you can find that on play account setting(not project!). On the page where you can see a list of your projects go to settings, and then on "Account details" page (scroll down, it's almost in the bottom of page) you will find the "Gmail accounts with testing access" list."
Set up application licensing
To set up application licensing, start by adding your list of tester's Gmail addresses in the Play Console.