MAS validate receipt (macosLib) problems

Hey guys,
It’s me and my MAS questions again… :stuck_out_tongue:

I’ve implemented the receipt validation function in macosLib but I can’t make it work.
This is what I’ve done:

Registered the Mac App ID in a reverse domain fashion.
Created a Test user in iTunes Connect.
In App.Open (at the top) I have this code:

  #If not DebugBuild then
    dim f as FolderItem = App.ExecutableFile.Parent.Parent.Child("_MASReceipt").Child("receipt")
    dim appBundleID as String = "macappID" // put the Bundle ID here that you registered in iTunes Connect for this app
    if not CertTools.IsValid (CertTools.DeviceGUID, CertTools.ReadReceipt(f), appBundleID) then
      declare sub exit_ lib "System" alias "exit" (code as Integer)
      exit_ (173)
    end
  #endif

I use App Wrapper Mini to do the fancy stuff for me when I Build.
If I validate my codesigning using this code it reports no error.

codesign -v APPPATH

When I launch the app it exits with code 173 as it should and asks me to “log in” to the App Store and I enter the credentials for my Test user created in iTunes Connect.
Launch the app again and I get a message telling me that the app needs to be re-downloaded from the App Store and exits with code 173 (looked in System messages).

Any ideas to help me out? :slight_smile:

Now this shows up in the os x messages log:

[quote]com.apple.launchd.peruser.501[198]: ([0x0-0x239e39c].APPID[82784]) Job appears to have crashed: Illegal instruction: 4
[/quote]
APPID is my app ID…

In 10.6 at least, you had to test your MAS apps by using the proper installation method from the PKG:

  sudo installer -store -pkg /path/to/my/app/installer.pkg  -target /

What OS are you running on / testing on?

Also, I’ve seen cases where the OS gets confused if you have more than one copy of the app on your hard drive - before testing, delete ALL copies of the app you are testing and empty the trash. Then install using the command line. Does it work then?

You have to test with a test account, not your normal App Store account. Are you doing that?

Yepp. I created a test account in iTunes connect and that’s what I’m using when it asks me to login :slight_smile:

[quote=39154:@Michael Diehr]In 10.6 at least, you had to test your MAS apps by using the proper installation method from the PKG:

  sudo installer -store -pkg /path/to/my/app/installer.pkg  -target /

What OS are you running on / testing on?[/quote]
I’m on 10.8.5.
Gonna try this tomorrow when I’m at a computer. My dev machine is being repaired.

In 10.8.5, you shouldn’t use “sudo” as it will ask for your password. But that’s an aside to your issue.

[quote=39154:@Michael Diehr]In 10.6 at least, you had to test your MAS apps by using the proper installation method from the PKG:

  sudo installer -store -pkg /path/to/my/app/installer.pkg  -target /

What OS are you running on / testing on?[/quote]

Looks OK so far

But the error is still there after I login win the test user I created in iTunes Connect when prompted to.
“blabla is damaged and needs to be downloaded from Mac App Store again…”

I created a new empty project and I got the same error. I must do something wrong…? :frowning:

Correct, if I use sudo it tells me not to :slight_smile:

I’m getting nowhere with this right now :confused:

When looking around on the Apple dev forums some say that I might have to create the app in iTunes Connect, just not upload it and it should work.
Could that be it you think? Doesn’t feel like that would make a difference.

Yes, iTunes Connect has to have the details of your app before you can test it.

Thank you, I’ll try that then :slight_smile:

Yup, I make this mistake frequently. Forget to set it up in iTunes connect.

The other thing to try, is selecting “Reset App Permissions” in AWM, sometimes a rouge permission can cause an issue.

I dont wanna know about yer makeup usage habits you rogue :stuck_out_tongue:

Damn, my in-ability to spell… Rogue. Right letters, wrong order.