-
-
Notifications
You must be signed in to change notification settings - Fork 695
Description
Right now if the warning "Duplicate purchase update skipped for..." is triggered, there is no way to know that this has happened, so the app just hangs, waiting around for a purchase success or failure that never comes.
Here's the code at question in the iap codebase, which seems to stop the operation but never errors out:
private func sendPurchaseUpdate(_ purchase: NitroPurchase) {
...
if isDuplicate {
RnIapLog.warn("Duplicate purchase update skipped for \(purchase.productId)")
return
}
Here's what my code looks like:
try {
iapPurchaseLoading('Purchasing...')
requestPurchase({
request: {
apple: {sku:'monthly'},
google: {skus:['landgrid.monthly']},
},
type: 'subs',
})
// This hidden warning can happen in the background: [RnIap] Duplicate purchase update skipped for monthly
iapPurchaseLoading('Sent Request...')
} catch(ex) {
iapPurchaseException(ex)
}
No exception is thrown here, and neither onPurchaseError or onError are called with this issue, so "Sent Request..." is the last message delivered to the user, and the screen loads forever.
In the Xcode console this message appears: [RnIap] Duplicate purchase update skipped for monthly
Ideally, a message would be sent to onPurchaseError or an onError message, at which point I could begin a restore-purchase process, or show a button to the user to have them trigger it themselves.
What is the recommended way to handle this issue? Thanks!