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.
Use the production URL https://buy.itunes.apple.com/verifyReceipt when your app is live in the App Store. For more information on these endpoints, see verifyReceipt. Verify your receipt first with the production URL; then verify with the sandbox URL if you receive a 21007 status code.
Receipt validation is a way to protect against fraudulent in-app purchases made in the iOS and Android app stores, and is used to ensure transactions occurred as reported.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With