You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please use the Discussion board if you want to get some help. Please use issues to report bugs.
Description
One of the user is not able to restore their subscription. They bought the subscription and were charged by apple but due to some reason (might be internet connection) the receipt did not reach backend and they did not get access. Now when they try to buy that subscription again, apple shows dialog that you can get this subscription when previous expires (Screenshot 1). Upon clicking subscribe for this subscription, they get the message: "All Set Purchase Successful" (Screenshot 2). But after that none of the listeners get activated, purchaseUpdated listner or currentPurchaseError. Although I tried to buy already bought subscription with another production account, it showed me popup in Screenshot 3 & it worked as expected.
Expected Behavior
User should get a popup in Screenshot 3. Instead they get popups in Screenshot 1 & 2 and no listener is activated to handle receipt.
Screenshots
(Screenshot 1)
(Screenshot 2)
Screenshot (3) Note: It is from beta version but I got the same in production on restoring subscription. Just this beta testers line was not there
Environment:
react-native-iap: ^12.12.2
react-native: 0.72.4
Platforms: iOS (Production)
To Reproduce
Steps to reproduce the behavior:
Buy an auto renewable subscription.
Try to buy it again if receipt is not sent to backend somehow & no access is given to user.
Try to buy subscription again.
[Optional] Additional Context
Again this is happening to one user in production out of 2 who bought subscription and could be related to apple than library. But we verified they have the production apple receipt which I am sending from home screen to backend. Also they have subscription active in their apple subscriptions section in settings. But trying to buy it again does not trigger listeners.
console.log('RECEIPT: ', receipt);
if (receipt && token !== '') {
// Give full app access
if (lastTransactionRecipe) return
lastTransactionRecipe = true
try {
const ackResult = await finishTransaction({ purchase: purchase, isConsumable: undefined, developerPayloadAndroid: undefined });
try {
//Api Call To Backend
} catch (e) {
setTransLoading(false)
console.log('Saving Subscription Success To Backend Error:', e);
}
console.log('ackResult: ', ackResult);
} catch (ackErr) {
setTransLoading(false)
// We would need a backend to validate receipts for purhcases that pended for a while and were then declined. So I'll assume most purchase attempts go through successfully (OK ackResult) & take the hit for the ones that don't (user will still have full app access).
console.log('ackError: ', ackErr);
}
}
}
};
checkCurrentPurchase(currentPurchase);
}, [currentPurchase, finishTransaction]);
// If user reinstalls app, then they can press purchase btn (SettingsScreen) to get full app without paying again.
useEffect(() => {
const checkPurchaseError = async () => {
console.log(currentPurchaseError, 'current purchase error')
Alert.alert("", JSON.stringify(currentPurchaseError))
if (currentPurchaseError) {
Alert.alert("", JSON.stringify(token))
if (currentPurchaseError.code === 'E_ALREADY_OWNED') {
if (token !== '') {
//setTransLoading(true)
if (lastTransactionRecipe) return
lastTransactionRecipe = true
// Give full app access
try {
//Api Call To Backend
} catch (e) {
setTransLoading(false);
console.log('Saving Subscription Success To Backend Error:', e);
}
}
}
}
};
checkPurchaseError();
}, [currentPurchaseError]);`
The text was updated successfully, but these errors were encountered:
Description
One of the user is not able to restore their subscription. They bought the subscription and were charged by apple but due to some reason (might be internet connection) the receipt did not reach backend and they did not get access. Now when they try to buy that subscription again, apple shows dialog that you can get this subscription when previous expires (Screenshot 1). Upon clicking subscribe for this subscription, they get the message: "All Set Purchase Successful" (Screenshot 2). But after that none of the listeners get activated, purchaseUpdated listner or currentPurchaseError. Although I tried to buy already bought subscription with another production account, it showed me popup in Screenshot 3 & it worked as expected.
Expected Behavior
User should get a popup in Screenshot 3. Instead they get popups in Screenshot 1 & 2 and no listener is activated to handle receipt.
Screenshots
(Screenshot 1)
(Screenshot 2)
Screenshot (3) Note: It is from beta version but I got the same in production on restoring subscription. Just this beta testers line was not there
Environment:
To Reproduce
Steps to reproduce the behavior:
[Optional] Additional Context
Again this is happening to one user in production out of 2 who bought subscription and could be related to apple than library. But we verified they have the production apple receipt which I am sending from home screen to backend. Also they have subscription active in their apple subscriptions section in settings. But trying to buy it again does not trigger listeners.
`useEffect(() => {
const checkCurrentPurchase = async purchase => {
if (purchase) {
const receipt = purchase.transactionReceipt;
The text was updated successfully, but these errors were encountered: