I have in-app purchases set up so that when a user clicks on the buy button, a "Please Wait" view appears and adds a payment to the payment queue. This always causes an immediate callback of the queue's observer saying that the transaction entered the "Purchasing" state.
My problem happens when the user returns to the main screen before the confirm to purchase dialog pops up, then cancels. If I wait around on the main screen awhile before switching back to the application, the application never gets any callback about the transaction switching state or being removed. If I examine the payment queue, I can see that the transaction is still in the queue, still in the "Purchasing" state. Is there anything I can do to make it call back and remove it from the queue after resuming the application?
If I understood your situation correctly, you've encountered this problem:
In App Purchase user cancels tx while app in background: tx state stays on purchasing
This appears to be a bug in Apple's Store kit. The issue can easily be reproduced if you send your app to background right after initiating a purchase and then pressing the cancel button when the buy confirmation popup is prompted. Your app will never receive the transaction failed(cancelled) notification and will enter a blocked state (if you disabled the UI trying to prevent the user from interacting with the app until the purchase has finished).
We have to wait for a fix from Apple. In the meantime, if your app is entering a blocked state because you disable UI while making a purchase; you should implement some mechanism to allow the user to leave that state.
Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With