Mac App Store receipt validation, for testing: I never get a receipt
Asked Answered
D

2

7

I've been fighting my way through receipt validation using Apple's code and a few guides on the internet. At this point, I've managed to sign the code, and start to validate to validate the receipt. At this point, it would be helpful to see this part of the Apple's documentation if you're not familiar with it:

Validating App Store Receipts # Validate during development process

When I launch the app within XCode, the app exits with code 173 as expected (there isn't a receipt to validate). When I launch the app outside of XCode (double click in finder), the app launches for a split second, closes, and a login dialog pops up (as expected). I've created a test account in iTunes Connect, and log in with this account. Once hitting the login button, a progress indicator spins for a couple of seconds and then the login box disappears. Nothing happens after this as far as I can tell. As I understand things, the App Store should automatically generate / pull a receipt and launch the application at this point, but it doesn't.

I've tried to observe the application launch process a bit better. I put in some printf's at each point of the receipt checking process, but I can't figure out where these would be printed. (Launching the app in the terminal using 'open' doesn't show any output at all.) I've tried using NSRunAlertPanel to generate dialog boxes, but I don't think enough of the app is loaded when the receipt checking occurs for them to come up properly.

At this point, I'm not sure how to debug the problem further due to not being able to really observe what's going on.

Dylandylana answered 1/6, 2011 at 2:9 Comment(1)
The exit code when receipt validation fails must be 173, not 137.Mainmast
M
7

Check that you have set up the app in iTunes Connect (you need to enter the details, you don't have to submit a binary).

*Originally taken from blog.pado.name/post/3008648963/app-store-receipt-validation-oddness, which is now a 404

Makalu answered 25/6, 2011 at 10:22 Comment(2)
It is also important that the version numbers in your Info.plist & iTunes Connect match. If you e.g. decided that you want to do a bug fix release 1.0.1, but in the end it is a 1.1 you will have to keep this in mind.Tubb
Heh, I was having issues with some MAS receipt stuff today and came across this post while Googling for a solution. It was frustrating to see a 404 link in the answer, especially since it's, uh, my blog that's being linked to. 🤦‍♂️ I managed to find the old post and have re-uploaded it here, in case it's still useful: pado.name/blog/2011/01/app-store-receipt-validation-oddnessKarttikeya
R
1

If you want to save a lot of time developing receipt checking code I highly recommend Receigen. (No, I'm not the developer of this tool but I prefer to add features and don't repeat what others have done in a great way.)

Make sure you signed the application with the development certificate in order to use the tester added in iTunes Connect.

Rea answered 12/12, 2015 at 17:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.