Hi,
After ios 14 was released we started see increase in errors DuplicateTransaction.
Out Current flow is
InitiatePurchase
On ProcessPurchase return Pending and send call to our server
On server response call ConfirmPendingTransaction
After last step we’re getting OnPurchaseFailed callback with reason DuplicateTransaction.
We spent time to research and found that if on second step return Completed for ProcessPurchase all works fine.
Bug happened only on ios14. Sometimes on first purchase, sometimes on 2d,3d etc. After this error user cant buy this item anymore and gets always this error. Easily reproduced if to buy the same item several times
IAP 2.0.6 is the Package Manager version, IAP requires both an Asset and Package Manager component. Can you update to IAP 2.0 from the Services window? Does this only affect iOS 14?
Please confirm which version you are using, please provide a screenshot when browsing to menu Window/Unity IAP/IAP Updates. Can you provide specific steps to reproduce? I’m not clear why you would receive DuplicateTransaction if this was the first purchase for a user.
As you can see on screenshot all is updated.
Unity version is 2019.2.20f1
Steps:
Purchase several times (3-6)t he same product using Saving purchases to the cloud flow on ios 14 in one app launch. After calling ClosePendingTransaction you should get onPurchaseFailed callback with reason DuplicateTransaction.
We tried Completing purchases immediately flow - all work fine.
Please show the screenshot of the menu as requested. You are showing the Package Manager version information. I don’t have a “Saving purchases to the cloud” flow here to use, sorry. Please use the Sample IAP Project and provide details for someone else to reproduce
Hello Jeff!
Same problem with Sample IAP Project.
I inserted my ID. I can only buy once, but when I buy it again, I get an error.
iPad (iOS 14). IAP 2.0.0
I had the same problem. It only occurs in iOS 14, but it works the same for IAP 2.0.6 as well as higher versions. In my case, from what I’ve confirmed, it’s not because of the ConfirmPendingTransaction() call, but because of the FetchAdditioinalProduct() that is called to update the product’s metadata immediately after that.
Duplcate Transaction Issue occurs only when FetchAdditioinalProduct() is called immediately after ConfirmPendingPurchase()
If you only call FetchAdditioinalProduct() without calling ConfirmPendingPurchase(), no error occurs.
If you call FetchAdditioinalProduct() after giving a delay of 2 seconds or more immediately after ConfirmPendingPurchase(), no error occurs.
When OnPurchaseFailed() with Duplicate Transaction is called, logging the product’s transaction ID confirms that it is empty.
So you’re not actually fetching additional products? What do you mean, “refreshing the store”. If there is a bug in other areas, you should not need to make this call just to update receipts. I’m trying to determine where the issue is.
We’re getting new list of products for user. To give him ability to buy them we need to call FetchAdditionalProducts in order to get metadata of new products.
Why we’re doing it with together with ConfirmPendingPurchase ? Once User finish his purchase we do two things close prev purchase and get metadata for new products as winny_lee if to put delay 2-3 sec on ConfirmPendingPurchase and only after it call FetchAdditionalProducts - all work fine. And again we’re facing it only on ios 14
Why are you doing 2 above? Why not just load them up during IAP Initialization to save time and bandwidth? What new products? There should be no need to wait 2-3 seconds, I’m trying to determine the underlying issue here. You are covering it up.
List of items we’re selilng is generic, we can’t init them all on app start. The question is why it works on all ios versions and on ios 14 doesn’t work.