This scenario can easily occur when an error occurs before calling SKPaymentQueue.default().finishTransaction(transaction).
As I know, it occurs when you bought the goods, but didn’t finishTransaction, maybe because of some network error or crash. Please check your code that if your handle this situation and finishTransaction at some point.
you don’t finishTransaction, then you cannot buy the same goods again.
I’m using the token to send them to my server and verify there, then add goods to users.
When will the callback be called with receipt token?
I thought it was after 3?
I encounter the issue too. It is sdkbox bug for IAP.
My IAP don’t verify with server. It is a local game.
I can reproduce the case easily by the following steps:
click the “buy” button.
send request to Apple server by sdkbox sdk.
kill the game by memory warning , let the game killed. (this will caused the finishTransaction function be not called, and the user can’t get any goods from IAP , although the user did purchase success . )
When you restart the game, it will popup out “This In-App Purchase has already been bought. It will be restored for free.” in your iOS devices. And you the user can’t buy the items again.
PS: All my goods are consumable too.
I tried to find some solution but found It have to call the Object C code and this will interrupt the C++ code flow.
Is it possible to fix this issue in SDKBOX lib only?