Changing App Store Selling Model to IAP

I have been selling about a dozen apps on the store mainly as a set price for the the whole App.
I am changing one in particular to be free with 2 IAPs which is working fine using the MBS Store plugin but how do I check if the user is a current owner ie has previously bought the program prior to the new version with IAPs as I don’t want them paying again?

1 Like

Would you get that kind of information from the App Store receipt using the MBS Store plugin?
@Christian_Schmitz maybe?

You can of course read the receipt.

But basically, when you get the event, you update your own records, e.g. you preferences database.

I can’t see in the existing example how to initiate a previous purchase.
How do I check that?

Without actual receipts, which you havent generated so far?

A simplistic approach:

Issue an update now which sets a flag/ stores a file on startup.
Give people a month or two to download it.

When the IAP version is ready, have it look for the file as a record of having bought the original.
If not there, you are starting from scratch as an IAP version.

you subclass SKPaymentQueueMBS to add events.
Then in finishTransaction(transaction as SKPaymentTransactionMBS) event, you look in the transaction, what was purchased.
Then look on the transaction to lookup the payment and there the product identifier, so you can remember that the client bought it.

OR read receipt with AppReceiptMBS class.

Thanks Jeff that would have been a great idea except I released the IAP version before I realized this would be a problem :frowning:
So now I have a few unhappy users that they updated but already purchased. Interim solution is I am supplying them some free store codes but it is a bit clumsy

Thanks Christian,

If they have previously purchased the App would - AppReceiptVerificatorMBS identifier produce a true result or is this for something else?

dim a as new AppReceiptVerificatorMBS

if a.verifyAppReceipt then
MsgBox “My receipt is valid”
else
MsgBox “My receipt is invalid.”
end if

I guess if I put this in the Open event it would only be checking the current version??

Maybe you make an update to the paid version first, which writes a flag to preferences file, that this is a paid version.

Later roll out the free + IAP and if the flag is set, the IAP is automatically marked as paid.

1 Like

The receipt file should always be valid, unless the app is hacked.

Christian has an example of checking the AppReceipt - this example gives you infos about the day of purchase, purchased version etc. With this info you can decide which customers should get the free update…

I couldn’t seem to get that example to show anything in the listbox

Not sure if my reply is useful but if I understand the problem properly, would it work with some kind of a “restore purchase”?

If the IAPs are non-consumable IAPs, you could try to restore its purchase which would give you the flag if it was purchased previously or not, directly from Apple. At least that’s my assumption. Somebody might correct me if that’s not true.

1 Like

Is the file “AppleIncRootCertificate.cer” available next to the project? This is needed for the check to work properly…

I am using that AppReceiptMBS check in my MAS apps to show these infos in the “About Window”:
Bildschirm_2023-01-12_09-32-18_AM

I’m probably misunderstanding but I went to my keychain and dragged the AppleRootCertificateAuthority.cer certificate out and dragged it into the App. Ran the MBSApp Example and put my bundle and version in but it comes up invalid receipt?

Just copy the folder “Verify App Receipt and In-App Purchases” with the example project (“Verify App Receipt and In-App Purchases.xojo_binary_project”) and the AppleIncRootCertificate.cer file from the dmg to your desktop, open the project and run it.

Result should look like this:

Still nothing??
Did you change the bundle identifier in build or just enter in the field? I tried both but no result??

It might be because you and Christian use the same App Store that it works??

You don’t have to change anything in the project, just open and run it.

Are there already more stores then the Mac App Store?

Did you select the receipt of your app, that was installed by the Mac App Store? Or which receipt did you check?

No I just thought the example might be coded to a region. What is the path to the receipt files you are testing? I don’t think I have any valid receipts to test might be the problem??