Testing MAS Purchases

I will be submitting my App to the Mac App Store and have receipt checking in place already using Macoslib

#If not DebugBuild then dim f as FolderItem = App.ExecutableFile.Parent.Parent.Child("_MASReceipt").Child("receipt") dim appBundleID as String = "com.kcmagicdata.KaiserOneMac" if not CertTools.IsValid (CertTools.DeviceGUID, CertTools.ReadReceipt(f), appBundleID) then msgbox "Missing Valid Store Receipt" declare sub exit_ lib "System" alias "exit" (code as Integer) exit_ (173) end #endif

I will not be using In-App purchase just straight Buy Now.

How do i test the Store Purchase and make sure the receipt check is working before I submit my app?
I dont see a way to test purchase my app anywhere. I can see it works when the receipt is not there but too confirm it will work if they have purchased.

Once you’ve wrapped the application for submission to the Mac App Store, then try to launch your application. If it works you’ll be presented with a dialog box asking for a iTunes account, you need to use a testing only account otherwise it will fail (and it sometimes used to corrupt the iTunes account). Once you’ve entered in the testing account details, your application should then load normally.

Or you can use my technique (NOT recommended) to just go ahead and submit it and wait for the reviewer to tell you it works or not. :wink:

Oh just noticed this, it can only be done (currently) from a plugin. While I have converted the API into declares, there is a limitation with the Xojo built executable that currently makes it incompatible. Basically the IAP re-enters your application on a different thread than the main thread, which is something that Xojo doesn’t support. Sadly more and more Apple API is starting to behave like this.

So, Sam, are you saying that receipt checking can only be done from a plugin and the code Kevin posted will not work?

No i think what he is saying is you cant get the App Store Sign in to come up without a plug in. Something needs to initiate the purchase and thats the part I dont know how. Atleast with in-app purchasing there is a trigger.

I was going to just submit and hope i get the only non pot smoking chimp at Apple.

I just noticed that after my app was prepared for the Store i ran it and after getting the missing receipt message it would then bring up the Apple ID signing prompts. If i used my test account it would activate it and if i used a non test account it wouldnt. Hope those are the results that are expected.

They are exactly as expected. Sounds like you’re ready to submit!

Huh… Somehow my previous reply didn’t come through…

You can use the receipt checking without a plugin (The code I use in our apps is available for free from http://www.ohanaware.com/xojo/), but to use In-App-Purchase you must use a plugin. Apple’s IAP functions renter the Xojo application on a different thread to the main one, and Xojo doesn’t like that. As more and more Apple API is heading that way, I’m confident that Xojo will have to ‘make’ it work in the future (just for the time being it limits your options).

These are the correct results. It’s probably different now, but don’t use the wrong account. It used to be that if you used the wrong account (live account when testing or testing account with a live product) it would corrupt that account.