Closed Darmaa-YoLo closed 3 years ago
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Version of react-native-iap
2.4.8
Version of react-native
0.58.3
Platforms you faced the error (IOS or Android or both?)
IOS
Expected behavior
return previous receipt
Actual behavior
return empty array
Tested environment (Emulator? Real Device?)
real device
Steps to reproduce the behavior
when i try to buy again it says "You've subscribed to This in the past" is it possible to connect iTunes to restore purchases of my non-renewable item
my buy method:
async inAppPurchase(productId) { try { this.setState({ isLoading: true }); await RNIap.clearTransaction() const purchase = await RNIap.buyProduct(productId) .then(async (purchase) => { await this.setState({ isLoading: false }); if (this.state.isLogged) { this._inAppPurchase(purchase.transactionId, purchase.transactionReceipt); } let date = moment.unix(purchase.transactionDate / 1000).format('LLL'); console.warn('date: ', date); if (purchase.productId === productId) { Storage.setStoreItem('restoredPurchase', purchase); this.setState({ restoredPurchase: purchase }); } await RNIap.finishTransaction() }) } catch (e) { Alert.alert(
${lang['Уучлаарай'][global.lang]}
,${e.message}
, [{ text: 'OK', onPress: () => this.setState({ isLoading: false }) }], { cancelable: false } ); } }my restore method:
async _inAppPurchaseRestore(){ if(Platform.OS==='ios'){ this.setState({ isLoading: true }); const possible = await RNIap.initConnection(); // await RNIap.consumeAllItems(); if(possible){ const purchases = await RNIap.getAvailablePurchases().then((purchases)=>{
}