For questions concerning the validation of iOS in-app purchase receipts against Apple servers, a recommended means of app billing fraud protection.
Questions tagged [receipt-validation]
212 questions
1
vote
0 answers
How do I prevent replay attacks/reuse of receipts when users restore in app purchases on iOS?
If a user makes a purchase, in order to prevent replay attacks (the user reusing an old receipt to get new content) I check if that transaction identifier has been used before. If so, rejected. It works great.
However, when the user "restores…

Doug Smith
- 29,668
- 57
- 204
- 388
1
vote
1 answer
Receipt validation is incorrect
I have tested on IAP of type Consumable with Sandbox environment. I want to make sure that the item I have bought is valid or not. but the result is always return with status "21004". I do nothing with share secret. So you can look the sample code…

Sovannarith
- 614
- 1
- 10
- 20
1
vote
1 answer
Auto-renewable subscriptions expiration date off Apple specification
I am trying to validate auto-renewable subscriptions on iOS. More specifically I want to:
1) Verify that the signature is correct [ √ ]
2) Verify that the subscription has not expired [ X ]
When I hand the receipt of to the server I get…

the_critic
- 12,720
- 19
- 67
- 115
1
vote
1 answer
iap receipt validation: security
There is a great post on StackOverflow about implementing in-app purchases with receipt validation. However it warns not to use that code as-is for security reasons. A sentiment found in many tutorials and even the Apple documentation. For example,…

user965972
- 2,489
- 2
- 23
- 39
1
vote
0 answers
How can I achieve IAP receipt validation to my server, via CargoBay?
I've set up some non-consumable IAP's in my application.
I'm being returned a list of my IAP SKProducts via the SKProductsRequestDelegate method -productsRequest:didReceiveResponse.
I'm also purchasing the IAP's (in Sandbox) just fine via the…

chris P
- 6,359
- 11
- 40
- 84
1
vote
2 answers
How to find the latest receipt of in app purchase using iOS 7 style receipt
I'm trying to get the latest receipt information locally on device when user purchase an in app item. My problem is i can not figure out how to get the latest receipt (should be the one that generated with the latest purchase) from the array of…

Peacemoon
- 3,198
- 4
- 32
- 56
1
vote
0 answers
In app purchase getting receipt and save it
My app has a server side receipt validation for auto renewable subscription.
Particularly at each restart the app needs to check if the receipt is still valid.
On iOS7 it seems pretty easy, with just those lines of codes i can get the receipt:
//…

Andrea
- 26,120
- 10
- 85
- 131
1
vote
1 answer
apple receipt validation woes
Folks,
Trying to validate a receipt on the server, and Apple documentations is vague at best.
From the docs last paragraph (https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html):
The…

Cmag
- 14,946
- 25
- 89
- 140
1
vote
0 answers
Receipt refresh in In-App Purchase sandbox environment: Is it possible to refresh the receipt without making a concurrent purchase of a test item?
I know I have configured my app (for iOS 7) correctly for the sandbox environment because I can make a test purchase, and I see the alert with the [Environment: Sandbox] text when the test purchase goes through. The receipt is refreshed at the same…

rfox
- 94
- 2
- 6
1
vote
1 answer
Error "Expected: [UNIVERSAL 17], expectation failed (tn=0, tm=0)" while parsing ASN.1 application receipt
I am currently implementing local receipt validation following Apple's Receipt Validation Programming Guide. I can obtain a test receipt but when I try to parse it as follows (i.e. as suggested in Listing 1-5 of the guide)
rval =…

Drux
- 11,992
- 13
- 66
- 116
1
vote
0 answers
Check that the SSL certificate used to connect to the App Store server is an EV certificate?
Apple suggests here that during receipt validation for In-App Purchase we:
Check that the SSL certificate used to connect to the App Store server is an EV certificate
How exactly does one do that in Objective-C on iOS?

Basil Bourque
- 303,325
- 100
- 852
- 1,154
1
vote
0 answers
In-app purchases receipt validation on server and new line characters
I'm currently working on a solution with In-App purchases which validate to our back-end server and I've come across some issue while sending the receipt to our server. When I retrieve it by doing
NSURL *receiptUrl = [bundle appStoreReceiptURL];
…

Rodrigo
- 733
- 1
- 10
- 26
1
vote
0 answers
Hacked Receipts Returning Status 0
We are validating receipts ON OUR SERVER and we are getting hacked receipts with are returning a status 0!
Here is our server code:
$postData = json_encode(
array('receipt-data' => $receipt)
);
//return $postData;
…

Aggressor
- 13,323
- 24
- 103
- 182
1
vote
0 answers
Receipt Validation iOS 7
I followed this tutorial and everything works. But Xcode show me that transactionReceipt is deprecated.
Now looking on google, I saw that you can change using this method:
[NSData dataWithContentOfURL:[[NSBundle MainBundle]…

Ilario
- 5,979
- 2
- 32
- 46
0
votes
0 answers
StoreKit configuration file and auto-renewable subscription validation?
Instruction how to create a StoreKit configuration file:
https://developer.apple.com/documentation/xcode/setting-up-storekit-testing-in-xcode/#
I use SwiftyStoreKit but the pure StoreKit behaviour should be the same.
I can get subscription info and…

Gargo
- 1,135
- 1
- 10
- 21