Current receipt is invalid or does not match user ID ds

I am trying to check in-app purchases for MacOS. After entering the credentials of the test user, the App Store complains: "The current receipt is invalid or does not match the user ID ds." and the purchase failed.

+8
cocoa app-store in-app-purchase macos
source share
4 answers

Is the receipt for the application you were running also for the same test user as the one you are trying to execute for in-app purchase?

If your debug version works without the correct receipt (from the same test user), I doubt that buying an In-App will work. Do not use the sample receipt when you want to test the purchase of the In-App, use the real version from the same test user, since you are going to buy the In-App product.

I was able to complete an In-App purchase on my own Mac app (although it is still not in the store), so if you have more questions, go away.

+3
source share

Some of the many things that I tried to solve this problem.


Receiving receipts on the App Store

UPDATE: Here is a comment by Rainer Brockerhoff from the bottom of this article. A much more elegant solution.

I do not see the need for all these distortions ...

To debug my check verification code, I simply create and then show the product application in Finder. Double-click it once and it will exit (173), then you will receive a receipt in the kit.

Now go back to Xcode and debug the check. The receipt will remain there until you clear; you can do it all again or copy the receipt elsewhere and return it after the assembly - at some point I had the receipt re-inserted into the script structure.

If you want to test the archived application, show the product in Finder, then go to several levels of folders in the "Release" folder and there you will see the application - you can double-click it there.


Long receipt procedure:

  • Archive application
  • In the organizer of Xcode
  • Select "Distribute" ...
  • Export as: Mac Installer Package

Finally, install it from the command line as follows

sudo installer -store -pkg (path to package including filename) -target / 

The application should now contain a receipt along the way

/Applications/SampleApp.app/Contents/ _MASReceipt / get


Confirmation Email

Apple sends an email when creating a test user in iTunes Connect.

Email subject:

Please check the contact email address for your Apple ID

My mail was in the spam folder, so I never saw it. Thus, the test user account has never been verified.


Check Status

In iTunes Connect, under Application Management > SampleApp > In-App Purchase Management

Here the status should say: ready to send

If this is not the case, you may need to upload a screenshot.

+6
source share

I will answer my question. I watched a video called β€œIn-App Purchase for iOS and Mac OS X” at http://developer.apple.com/videos/wwdc/2011/ .

The key part was loading the application receipt at startup. The code for inclusion in the App Delegate was something like this:

 - (void) applicationWillFinishLaunching:(NSNotification *)notification { if(![[NSFileManager defaultManager] fileExistsAtPath:[[[NSBundle mainBundle] appStoreReceiptURL] path]]) { NSLog(@"to get sandbox receipt, the app must be launched from outside xcode"); //exit(173); } } 
+5
source share

i myself was very hard pressed to integrate the in-app purchase into Mac OS X.

I walked a lot, but nothing worked out with a solution. Finally, the apple developers came to the rescue. mainly it was said about the reason in wwdc 2012 that an error occurred in MAC OS X (version 10.7.2), due to which it was not possible to receive a receipt.

This error was resolved in the latest version, i.e. MAC OS X (version 10.7.4)

I just updated my OS and was able to get a receipt. So friends who have ever encountered the problem "Current receipt is invalid or does not match user ID ds." just upgrade your OS to 10.7.4 and apso write down the following code in your application deletion "applicationDidFinishLaunching" -

 if(![[NSFileManager defaultManager] fileExistsAtPath:[[[NSBundle mainBundle] appStoreReceiptURL] path]]) { NSLog(@"to get sandbox receipt, the app must be launched from outside xcode"); exit(173); } 

and run ur code for the first time outside of Xcode. then after receiving the recipt u can be debugged again from Xcode.

Every time you clean the assembly, you must run the ur application outside of Xcode.

+5
source share