[Closed] IAP sometimes fails to give coins on iOS

We currently have a game live on android, iOS, and Facebook. Everything seems to work decently and we have not experienced any issues over all, except on iOS sometimes.

We keep getting reports that sometimes players are not getting their coins when purchasing off the store on iOS. It doesn’t appear to be an overall issue, as most are making purchases just fine. However, some are not getting their coins but have showed us proof of purchase and when we check their accounts, they do not show the coins added that they bought.

This issue doesn’t happen on Android (using unity IAP) or Facebook(currently using Facebook IAP).

It currently happens enough times to raise a bit of concern as it does take us time to manually add coins, but I know our players can get frustrated.

I’m just trying to see if others have experienced this issue and have a clue if something is done on the Apple side that maybe would prevent the proper message from coming back or if anybody knows if Apple sometimes has a delay(processing card, so we don’t get a message back right away?).

I appreciate any suggestions on what may be the issue. Thank you.

To add, today we got a report from a player (they included screenshots) where they didn’t get their coins. They then were asked if they would mind making another purchase and they agreed to help us out and see if we could solve this issue. However, when they went to make the purchase (they were buying the same bundle as before) it claimed it was already purchased and it would try to restore it for them.

Now, we did double check and the item is setup as consumable in both the iTunes store and in the code, so it doesn’t appear to be a problem with how we have things setup. We also have had several people making purchases without issues. It’s just a few purchases that don’t complete and now this one message.

Is it possible Apple is doing something on their end where coins aren’t always getting rewarded to the player right away?

We are experiencing no issues on Android, but getting a couple each week for iOS.

Thanks for any help provided.

Hi Brathnann,

I can’t really speak to your specific situation without knowing more info, but this is what we do to nail any IAP issues:

  • Log every step of the purchasing process to the server: when they start purchasing, if they cancel, if there was a problem, if it worked, when you’re going to validate, when you’re about to send it to the server, when you receive the result. This will give you an idea of what’s going on and where people are getting stuck

  • Really, log everything. The amount of fraud attempts is far bigger than I thought it’d be

  • If validation doesn’t work for whatever reason, log the entire receipt to the server (I’d even say log it anyway). This will let you manually verify it by hand afterwards if needed. There are two outstanding issues that we have:

  • Rarely, we’ll get a InvalidSignatureException when validating locally on an otherwise valid receipt (I’ve sent a support request on this)

  • Players using Ask to Buy will return empty receipts that will validate locally, but not on the server (Again, I’ve sent a support request on this). Currently workaround is to tell them to turn off the feature, then make the purchase

  • Once it’s validated locally, send it to the server and validate it there. When it works, stock the entire receipt on the player (useful later). Make the transaction ID searchable

  • If it validates remotely, make sure another player hasn’t already validated it (searchable transaction ID). This can happen in two instances:

  • A player is trying to hack your game with previous valid receipts

  • On iOS, if an IAP isn’t consumed, it’ll be sent along with subsequent receipts (i.e. one receipt, multiple IAPs), so it’s possible in certain cases where a player can try to validate a purchase again. For non-consumables, the IAP will always be in the receipt unless I’m mistaken (we don’t have any, so I could be)

  • Make sure you’re calling ConfirmPendingPurchase on your products in all cases. It looks like you’re missing one (“it claimed it was already purchased”). We do this even if the validation failed. Better to manually gift the item to the player than have it permanently blocked

  • For any Android players getting in touch, tell them to go here: Redirecting... and send the GPA Transaction ID. You can use this to validate purchases (saved, searchable receipts), or find old accounts. You can also take it into the Google merchant site and see the status of the payment yourself

  • For iOS players, I don’t currently know of a way to match what’s in the receipt email with the IAP receipt which is a massive shame (if anyone knows differently, I’ve love to find out), so I generally take iOS claims with a pinch of salt. Ask them to forward the email (not a screenshot), and you can also base on history (previous purchases/previous logged fraud attempts). Worst case, tell them to click on the refund link in the email

Handling iOS validation is much harder than Android because of the way they do their receipts, which is why you need to log everything to know where it’s going wrong.

To answer your question: “I’m just trying to see if others have experienced this issue and have a clue if something is done on the Apple side that maybe would prevent the proper message from coming back or if anybody knows if Apple sometimes has a delay(processing card, so we don’t get a message back right away?)”, no - when you get the receipt, the purchase has gone through. Apple might not actually charge their card right away, but you should be able to query their servers to see if it’s a valid purchase or not.

Also: “However, some are not getting their coins but have showed us proof of purchase and when we check their accounts, they do not show the coins added that they bought.” We’ve had cases of players complaining that they never received their purchase when they bought it, then immediately spent the coins, only to get in touch with us afterwards. Log everything

2 Likes

Thanks for the tip! We actually track many of what you say, including addition and subtraction of coins (we can check to see if they actually got their coins or not and if they spent them quickly after). We also track purchases, so we can see when a purchase has processed and coins were rewarded.

We do have other systems in place, but you did give a few tips that are always helpful. (We basically are trusting on the players side on these).

So I wasn’t sure if it was an iOS issue(since android has never reported a problem) or even if it’s a slow internet or if the player gets disconnected after submitting the order or something.

So I wasn’t sure if it was an iOS issue(since android has never reported a problem) or even if it’s a slow internet or if the player gets disconnected after submitting the order or something.

The order gets handed off to the OS, so they should have good safeguards in place in terms of slow internet/getting disconnected afterwards etc. UnityIAP are also pretty good in that they’ll keep notifying you a purchase on every start up until you’ve called ConfirmPendingPurchase on it. We’ve had a few cases where we weren’t handling an edge case properly, so even though we manually gave the purchase through support, they automatically got it again on the next update.

Depending on your game, another thing to look out for is if your game needs something like a persistent socket connection. When the IAP dialog pops up, your game is frozen in the background, so it’s highly likely that they’ll trigger a socket timeout, meaning that when they come back into the game, your game disconnect logic will kick in and they might get booted off that screen.

Again, log everything; even failed purchases. Then you’ll have a much better idea of what’s going on