-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't working
Description
My current game has IAP coin packs which the player can buy.
When the player first buys a coin pack, it works fine.
The second time the player tries to buy the same coin pack, it throws up an error stating the player already owns the product.
The third time the player tries to buy the same coin pack, it works fine.
The above image shows the purchase error on every other attempt by the user.
// Starts the buying process
InAppPurchaseActivate(iapCoinPackID)
Repeat
iapStatus = GetInAppPurchaseAvailable2(iapCoinPackID)
Select iapStatus
// Cancelled? The IAP was cancelled by the user
Case 0:
// Break out of loop
finished = true
Endcase
// IAP Queued
Case 1:
Print("IAP in progress..")
Endcase
// IAP In progress
Case 2:
Print("IAP in progress..")
Endcase
// IAP Pending
Case 3:
Print("IAP in progress..")
Endcase
// IAP Completed
Case 4:
// Award the IAP
// Add the relevant amount of coins to the player total
Inc player.coinTotal, coinPackAmounts[iapCoinPackID - 1]
// Break out of loop
finished = true
// Resets the purchase
token = GetInAppPurchaseToken(iapCoinPackID)
InAppPurchaseResetPurchase(token)
Endcase
EndSelect
sync()
Until finished = true
The above code handles the purchase and resetting of the products. I have tried several different things to try and resolve the issue, moving the InAppPurchaseResetPurchase(token) around and putting it in a loop.
Edit<
I forgot to say this is an issue on Android
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
