skip to Main Content

So I followed the official manual and implemented this:

https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#//apple_ref/doc/uid/TP40010573-CH104-SW1

  1. user pays in app
  2. app gets receipt info from Apple
  3. this receipt info is sent to my server
  4. my server verified receipt by calling Apple API and activates membership for client

The obvious problem is that 3. can fail. I have clients complaining they paid, they are sending me SS of the amount being deducted, but my server was never notified. And I have no way to find these users. Is there some CP where I can search by customer e-mail or transaction ID to check if this is Photoshopped screenshot or valid one?

Is there some API that can be called to list transactions by product and e-mail of client?

https://appstoreconnect.apple.com/ – Apple CP is useless for this

2

Answers


  1. There is no method to correlate the customers details with your transaction details. Only Apple can do this.

    My first suspicion is that you may have a logic problem in your purchasing process. If implemented correctly, a transient failure at step 3 doesn’t matter.

    You should:

    1. Create your transaction queue observer a soon as your app starts. This will enable any pending transactions to be delivered to your observer
    2. When you get a purchase transaction in your observer you verify with your server
    3. Only once you have a response from your server that the purchase has been recorded successfully do you call finishTransaction.

    This way if something goes wrong with your server or the app crashes the transaction is still pending in the queue.

    If you are using auto-renewing and/or non-consumable IAP then I
    strongly suggest you provide a “restore purchases” button in your
    UI. This makes it simple for the user if something goes wrong or when
    they move to a new device.

    If you have users who claim that they did not get what they paid for then you can refer them to Apple App Store support who can refund the transaction.

    Login or Signup to reply.
  2. If step three fails you can fall back to local verification and then let the user through for this session (or some number of sessions before you require it to succeed). Unfortunately local authentication is a pain in the ass because the receipt is encrypted. See this link for an example: https://github.com/andrewcbancroft/SwiftyLocalReceiptValidator . You can also report failures of step 3 to your analytics tool so you can see who is actually affected by this issue (obviously this only works if the analytic eventually get an internet connection.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search