Cocoa Receipt Verification testing under Mavericks - issue

1.1k views Asked by At

Everything was working perfectly under Mountain Lion. Mavericks, not so much.

The issue: I'm unable to carry out any receipt verification testing under Mavericks.

I'm using Receigen (Mac App Store/MAS) to generate both startup and in-app purchase receipt verification. I'm using Xcode 5.02 under Mavericks 10.9.

Here is the way it worked under Mountain Lion…

Archive the app and export it to an application. Make sure you are logged out of your personal MAS id. You'll use your iTunes Connect testing ID later. From the Finder, run your exported app.

After you launch your application, the following occurs:
• Your application fails to validate its receipt because there is no receipt present, and it exits with a status of 173. This is expected. • The system interprets the exit status and attempts to obtain a valid receipt. Assuming your application signing certificate is valid, the system installs a valid receipt for the application. The system should prompt you for your MAS credentials. You will use your testing account here. • The system relaunches your application, and your application successfully validates the receipt.

This is what happens under Mavericks…

Same as above - archive/testing MAS ID/Finder run app.

However, now I receive this in the Console: Exited with code: 173 [this should be okay just like above] storeagent: Unsigned app (path/to/app).

???

No MAS credentials. Nothing. I've triple checked the code signing using both the Organizer/Validate as well as Receigen. Both tell me my app is signed properly with no issues.

Funny thing, I've submitted the app to the app store and after approval, it works. So it's signed correctly and receipt validation is working.

But, I'm unable to carry out any receipt verification testing. That's the issue.

Thanks for your time. Kevin

4

There are 4 answers

3
Wil Shipley On

This does indeed appear to be a Mavericks bug.

Craig Hockenberry had the same problem on 10.9 (so did I) and his solution worked for me:

killall -KILL storeagent

See his blog.

1
Tap Forms On

With the help of the Receigen author (Laurent Etiemble), executing the following commands helped me:

spctl -vvvvv --assess <YourApp>.app

For the app I submitted to Apple, I got the following message:

/Path/to/my/app/Tap Forms.app: rejected

To fix it, you need to do this:

spctl --add --requirement "anchor apple generic and certificate leaf[subject.CN] = \"3rd Party Mac Developer Application: <Your company name> (<Your organization ID>)\"" --label "MAS"

Then when you execute the spctl -vvvv --assess .app command, you get this:

/Path/to/my/app/Tap Forms.app: accepted
source=MAS
origin=3rd Party Mac Developer Application: <Your company name> (<Your organization ID>)

So now I've resubmitted my app and we'll see if it gets rejected for not being able to launch.

0
paxos On

Don't forget sudo:

sudo killall -KILL storeagent

This worked for me.

0
Aidan On

My problem was that in Xcode I was signing the app with the "Mac Distribution" code signing identity and not the "3rd Party Mac Developer Application" one.

After changing the signing identity, I rebuilt the app, then deleted the app's container folder located in ~/Library/Containers/<The Apps Bundle ID>.

Then, double clicking on the rebuilt app in Finder, I was finally prompted to enter App Store credentials. I then entered the credentials of an iTunes Connect test user that I had setup, and the receipt was generated and the app launched ok.