"react-native-iap": "^2.3.12",
both
array not empty
[]
Iphone 6s and Samsung galaxy S6
I have purchased completed one subscription on android and one non-renewable subscription on ios , then I use method getAvailablePurchases() to get information purchase but they return a array empty.
_getAvailablePurchases = async () => {
try {
const purchases = await RNIap.getAvailablePurchases();
console.info('Available purchases :: ', purchases);
} catch (err) {
console.log(err)
}
I am using account sandbox on IOS and Android
One of the most asked questions in issues. I think I should write this up in Q&A soon. It will help you to understand the process of in-app purchase better if you read the official docs provided in each platform (android & ios).
getAvailablePurcahses is used only when you purchase a non-consumable product. This can be restored only. If you want to find out if a user subscribes the product, you should check the receipt which you should store in your own database. Apple suggests you handle this in your own backend to do things like what you are trying to achieve.
I'll close this issue soon.
Most helpful comment
One of the most asked questions in issues. I think I should write this up in
Q&Asoon. It will help you to understand the process of in-app purchase better if you read the official docs provided in each platform (android & ios).getAvailablePurcahsesis used only when you purchase a non-consumable product. This can be restored only. If you want to find out if a user subscribes the product, you should check the receipt which you should store in your own database. Apple suggests you handle this in your own backend to do things like what you are trying to achieve.I'll close this issue soon.