Version of react-native-iap
^4.4.3
Version of react-native
0.61.5
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
getProducts()
=> ProductList [...]
Actual behavior
consumeAllItemsAndroid()
=> promise.reject("refreshItem", "No purchases found");
getProducts()
=> ProductList []
Tested environment (Emulator? Real Device?)
Emulator, Device
Steps to reproduce the behavior
I tested it on a real device as advised in the following link, but it still returns no results
https://github.com/dooboolab/react-native-iap/issues/972
Even if I have registered the in-app payment ID in the Google Play Console, if the app posting has not started, can't I check the return value for getProducts using the in-app payment ID?
How can I check the return value for getProducts?
+1. It would be so great to have sth. like a definitive checklist for everything (iOS & Android) that needs to be set up in order to get IAP to work.. until then, working with IAP is a royal pain in the *ss..
I ran it on the android device.
I will check again as advised. Thx
@bhoomika-sorathiya Could you please share some of your codes so we can predict where it may cause the problem?
To give a little advice, I made the following settings
Perhaps you can test it if you complete these basic setups.
@hyochan I have followed below steps for code:
Step 1: I have written below code in componentDidMount to initConnection which always use to warn "RefreshItem"- "No purchases found".
// Init IAP
try {
const result = await RNIap.initConnection();
await RNIap.consumeAllItemsAndroid();
console.log('result', result);
} catch (err) {
console.warn(err.code, err.message);
}
Step 2: For getting products list, I have used below code where products is always coming as [].
const products = await RNIap.getProducts(itemSkus);
@k8759102 , Thanks for advice. I have double checked. For me, I have published my app to production on play store which full rolled out as per attached screenshot.

I have added products as well on play store inapp purchase section which is already active.

I am not sure. Now, which step I am missing?
In my case, most of the problems were caused by the setting and procedure of each play store, rather than the code problems.
In fact, there are additionally configured parts, but there are some items that I did not add because I thought that there would be no need.
I hope these parts helped you.
@k8759102 Thanks for quick reply. Can you please provide more details on this configuration on google play console?
+1
Source for the whole application:
const App: () => React$Node = () => {
const [productsJSON, setProductsJSON] = useState()
auth().onAuthStateChanged((user) => {
console.log(user)
})
useEffect(() => {
const _myF = async () => {
console.log("Ciao")
let outcome = await RNIap.initConnection()
console.log("Outcome: " + outcome)
let products = await RNIap.getProducts(['modulo_training_autogeno'])
console.log(JSON.stringify(products))
setProductsJSON(JSON.stringify(products))
}
_myF()
})
return (
<>
<Video source={{uri:''}}
ref={ref => AudioPlayer = ref}
playInBackground={true}
controls={true}
fullscreen={true}
/>
<Text>{productsJSON}</Text>
</>
);
};
Got 1 active product on Play Console. Pushed signed apk for internal test.

getProducts(['modulo_training_autogeno']) is the empty array on Android
I've been struggling with this problem for a week. Finally figured it out today. I removed the billing permissions from the android manifest and android gradle build files, and now it connects and I get products returned. This stack overflow was how I came up with it. Not sure if it will cause problems further down the line??
I have the same problem. For me, getSubscriptions works, but not getProducts (I have both) with [email protected]
However I did some testing. And with @3.3, it works! But @3.4 or newer it does not work, so something may have been broken between those versions.
I have the same problem. For me,
getSubscriptionsworks, but notgetProducts(I have both) with[email protected]However I did some testing. And with
@3.3, it works! But@3.4or newer it does not work, so something may have been broken between those versions.
I am concerned with what @mifi written because I've not experienced this in 4.5.* which is recent. Please make sure you've correctly cleared the cache (also by removing yarn.lock or package-lock.json) when you are switching react-native-iap's versions.
@hyochan I'm sorry, I mistakenly thought 4.4.4 was the latest version (it says so on GitHub). With 4.5 it works. And 4.4.4 also works when I tested again now, so I'm not sure what happened there. May be some cache or other issue. (I didn't have to do anything about yarn.lock but it still works)
@hyochan I'm sorry, I mistakenly thought 4.4.4 was the latest version (it says so on GitHub). With 4.5 it works. And 4.4.4 also works when I tested again now, so I'm not sure what happened there. Maybe some cache or other issues. (I didn't have to do anything about yarn.lock but it still works)
NP! This usually happened when installing react-native modules with different versions back and forth. I've just wanted to clarify that. Next time please ensure that you've installed them correctly if something isn't working as expected.
Sometimes removing node_modules and install packages again helps either.
Looks like this issue can be closed.
Hi,
I am getting empty array when I run getProducts() or getSubscriptions().
I ejected from expo. deleted and reinstalled node_modules and yarn.lock.
I am using IOS. All the product ids are similar to the entries created on App Store connect.
try {
const result = await RNIap.initConnection();
console.log('Result: ', result);
} catch (err) {
console.warn(err.code, err.message);
}
if (Platform.OS == 'ios') {
try {
const iOSProducts = await RNIap.getProducts(items);
console.warn("componentDidMount -> products", iOSProducts);
//this.setState({ iOSProducts });
} catch (err) {
console.warn(err);
Alert.alert('Error', err)
}
I have the same problem. For me,
getSubscriptionsworks, but notgetProducts(I have both) with[email protected]However I did some testing. And with
@3.3, it works! But@3.4or newer it does not work, so something may have been broken between those versions.
i'm trying with 4.5.0. do you have any suggestions?
@safciplak Try to release the app to alpha first, see: https://github.com/dooboolab/react-native-iap/issues/999#issuecomment-666301261