question

giorgiotino avatar image
giorgiotino asked

VerifyiOSReceipt fails if any of the included products cannot be validated

I have just figured out that Client/ValidateIOSReceipt fails for every product in the receipt if any of them cannot be validated.

I purchased an item on Sandbox, and surprisingly enough the Apple receipt had two entries in the "in_app" array - one for the actual item I just purchased, the other one for an old item that I probably tried to buy a couple of months ago while developing the game. Such item IS NOT PRESENT anymore in the main catalog and has been revoked and removed from iTunes connect. Nevertheless, for some unknown reason, Apple keeps sending that back in any receipt.

When I added an item with that id back into our main catalog the purchase went well and the problem was resolved, but I have to keep that old item in the main catalog just to validate any transaction.

I was wondering if:

- There is a way to Validate (and grant) all the VALID items in the receipt instead of faling for all of them if there's one that is not valid?
- Are you suggesting that we should never remove items from the main catalog once they were available for purchase in order to avoid this problem?

Or maybe there's another approach and I am missing something?

(Note: I haven't tested Android, and I wonder if there might be a similar problem or not?)


10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

May I know the error details of your call to ValidateIOSReceipt? And, as per Apple’s doc:

“Purchases for non-consumable products, auto-renewable subscriptions, and non-renewing subscriptions remain in the receipt indefinitely. For consumable products, the transaction is added to the receipt when the purchase is made, and remains until your app finishes that transaction. It no longer appears in updated receipts after you call finishTransaction(_:).”

https://developer.apple.com/documentation/appstorereceipts/responsebody/receipt/in_app

That might be the reason why the old item is still present in the receipt, if you believe that’s an error, please contact Apple for help.

And, for PlayFab, the Product IDs in your receipt need to match the ItemId of all the items in your primary catalog, in your case, I would suggest not remove items from the primary catalog unless you are 100% sure that they shall never show up in the receipts again.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.