MAS In-App Purchase

Hi. I see that MBS have plugins to handle this but because I have never made an in-app purchase through a MAS product I need a little clarification about how the process works so I can design the best solution for my app…if it is accepted.

Basically the app I submit will be the full working “paid” version but I wanted to either include an in-app purchase to unlock a specific feature and/or in-app purchase for a bundle of or single plugins that were hard-coded into the app.

  1. If the in-app purchase was to unlock a specific feature then once purchased I assume I would need to be able to check that in-app purchase was paid for (I guess upon launch by checking purchase receipt somehow) and then set a boolean to true and refer to this in my code etc. Question in this regard is would I need to check the receipt on each launch or should I store true or false in a prefs file and just refer to that?

  2. If a customer purchased a plugin (or bundle of plugins), rather than downloading a file and installing it on their system (as my non-MAS app does) my intention was to include the file code in the app as constants and when purchased write the binary data to a file within the sandboxed user folder. Question in this regard is similar to the above: would I need to check the store receipt for each plugin purchased upon every launch and then if it is a valid purchase would I then have to see if the file had already been created and installed and if not create it again?

  3. And how would this work if the user download the purchased app on a different computer? Do the in-app purchase receipts automatically download with it?

  4. Finally, how are available in-app purchase products displayed to the user? If it’s just to unlock a single feature then would I just have a “Unlock Pro Feature” menu item? And if it’s to purchase individual plugins would I need to create my own plugin list window with separate buy now buttons for each plugin or does the in-app purchase system handle all of that for you so you can buy a single plugin or a bundle of them?

Sorry for all the questions!

You can use preferences file or check receipt.

Our receipt checking classes:
http://www.monkeybreadsoftware.net/pluginpart-verify.shtml

I would assume you include all features in the app and just unlock them. Writing out plugin files doesn’t sound good.

You may need to implement StoreKit methods to restore purchases, e.g. call restoreCompletedTransactions method:
http://www.monkeybreadsoftware.net/pluginpart-storekit.shtml

You may need to make a nice window showing the items to buy and put a purchase button there to buy the item.

Thanks, Christian. Does anyone have a screenshot example of what the in-app purchase looks like for a single item (i.e. unlock feature) and multiple items? Can you add them to some kind of cart? Is it all done via App Store or a separate modal window?

Also, how can all of this be tested? Do you have to purchase your app as a developer for free from the App Store and install it and then try to invoke in-app purchase or can you try to invoke it from your sandboxed app without having to download it from the store?

This is “verboten” in a sandboxed app.
While I have several apps on the MAS, I have yet to implement IAP’s as my only understanding is that they are decidedly non-trivial. I will be following this thread as well.

Why would this been forbidden if by “sandboxed user folder” I mean the ApplicationData folder specific to the app?

When you initiate a purchase, you get the login dialog for iTunes Store and a confirmation dialog from Apple.
You can try my example coming with plugin.

Or come to UK conference and I show you.

Misunderstanding of terms. When you said “sandboxed user folder” I assumed you meant the folder containing the app.

  1. The safest way is to set a boolean within your application when the user purchases, and check the receipt on application launch, don’t store the value in your preferences as that can easily be edited (or maybe you do, but fix it later).

  2. You could always create a download system, so that once payment has been approved and if the files don’t exist, your application downloads them to it’s application container.

  3. If you follow Apple’s guidelines, you need to add a “Restore Purchases” button, will should make the MAS agent go, check and update the receipt if needs be.

  4. However simple or complicated you want to make it. I would advise reading up on Apple’s IAP guidelines and/or checking their latest suggestions on how to provide an interface and what they currently like/don’t like in regards to how to position a button or interface for doing so. If you get an uptight reviewer, they can seriously slow your app release down.

Yes it can all be tested from a sandboxed built app, you have to use a special “test” user account, which you can set-up in iTunesconnect.