- Home /
Prime31: Completing an in-app purchase on app crash
So I'm having this issue where I clicked the "Buy" button from within my game, and it crashed just before the Confirm Purchase window popped up.
This caused the "Confirm Purchase" display message to come up while on the home screen. When I confirmed the purchase, it then displayed the "Thank You for Purchasing" pop up as if it completed the transaction.
I then relaunched the game. On game Startup, I called this method:
StoreKitBinding.getAllSavedTransactions();
That is supposed to return a list of all transactions made, but it returned an empty list. On entering the game, I had not been rewarded the item I just purchased. I cannot purchase that item anymore because it pops up with the "You have already purchased this item" message.
So, what happened to that transaction? Is there any Prime31 method for retrieving "lost" transactions?
Note: This also happens if I quickly suspend the game immediately after clicking the "Buy" button from within the game but BEFORE the Confirm Purchase window pops up.
Thanks,
-B.
Answer by Mr_Recursion · Oct 21, 2014 at 04:28 PM
I solved it. What I did was call:
`StoreKitBinding.forceFinishPendingTransactions();`
and that automatically finishes any pending or "lost" transactions.