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).
[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…
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?
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…?
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.