Hello,
I have a React Native iOS project where I am incorporating RevenueCat Consumable in app purchases. We noticed that there is an edge case with the purchasePackage flow described in the documentation here: https://docs.revenuecat.com/docs/making-purchases
try {
console.log(`Making purchase`);
await Purchases.purchasePackage(productPackage);
console.log(`Purchase successful`);
} catch (error) {
if (error.userCancelled) {
// do nothing
} else {
// do error logic
}
}
If there is an internet disruption or the app crashes during the execution of that purchasePackage promise (after the payment is authorized in the payment sheet but before the promise resolves), the payment can get in a weird state where it seems to be recorded but not recognized by RevenueCat. We do not get a web hook until either the user tries to purchase the product again or the user successfully purchases another product. In the case that the user tries to purchase the product again, it seems to recognize the previous authorization as it does not show the native iOS payment sheet and just synchronizes the previous purchase.
I realize this is an edge case, but is there a way to force RevenueCat to sync with the underlying payment queue to avoid this behavior. Or is there a recommended way to handle this behavior? Is it typical to force the user to try to purchase again?
Thank you!