Check out the new @mentions and Tagging Feature!
We're testing a feature out on the forums, user @mentions (Twitter style). You can also tag users on a post/thread at the top of each page.Please have a play and PM Simon or post here if you experience any issues.

In-App Purchases - a guide

Hi everybody!
This is a small guide to create and use In-App-Purchases using the iOS Store extension.

First, you must go to iTunes Connect and sign in with your Apple ID.
Note that you must have the right contracts signed to use IAP's.

Select "Manage Your Applications" and select your app that you have previously set up that you wish to add IAP's for.

Important: The "Bundle ID" of the app you are setting up IAP's for should match the Bundle ID that you are using in your MFA file.

Then click 'Manage In-App Purchases' in the menu at the right.

Under "In-App Purchase Summary" you will find a button to create a new IAP:

You must decide which type of item you are in the process of creating.
For this guide I'm sticking to simple non-consumables - which basically means that once you buy the item you will have it forever.

You should then chose a reference name for your item. This item name is only for your own reference.
It will not be shown in your app.

You must then chose a product identifier.
It is a good idea to use the inverse URL way of making an unique identifier so it doesn't clash with any other name you might be using.
For example: "com.companyname.gamename.itemname"

Under "Pricing and Availability" you must select which price tier the product should be in:

Under "In-App Purchase Details" you must name your item and describe it in the languages you decide.

Save it:

Here i added the item name and description in English and Danish:

You must decide if the content of the item is downloadable or simply just "unlockable" from your game.
If the item requires that you download some content from a server you can choose to host it on Apple's servers.

It is optional if you wish to fill out the review notes but you must supply a screenshot to Apple for
review purposes so they can see what the IAP is all about.

I have written a bunch of comments inside.
Please note that this is just one way of doing in app-purchases.
You can also fetch the list of items from a server using the GET Object and then fetch the item information.
You can also use the 'specific' conditions in the iOS Store object to hardcode the identifiers if you don't need to have that many IAP's in your app.

In my example file I dynamically created the buttons as the information is retrieved but you can easily
have them created beforehand with prettier graphics and then show a "progress/loading" indicator while it fetches the product information from the store.

When you are all set: export and try it in the simulator (to run it in the sandbox):

Please note that the sandbox can be quite slow at fetching the product identifiers.
It will take a while before they are shown on the screen in my example.

Also please read the help-file of the iOS Store object to read more about how In-App Purchases work.

I'm having a little trouble when I test it on the device. It comes up with the price, and the product details so I know its connecting and getting the data correctly.
When the user clicks to buy it pops up asking if they want to buy (sandboxed). But then nothing happens. I don't get a payment failed notification and it doesn't purchase the item no matter how long I wait.

Is this a sandbox problem or is it a problem with user certificates or something along those lines.

I'm having a little trouble when I test it on the device. It comes up with the price, and the product details so I know its connecting and getting the data correctly.
When the user clicks to buy it pops up asking if they want to buy (sandboxed). But then nothing happens. I don't get a payment failed notification and it doesn't purchase the item no matter how long I wait.

Is this a sandbox problem or is it a problem with user certificates or something along those lines.

First, go to your device settings and sign out of iTunes. It's probably trying to use your currently logged in iTunes account as a Sandbox account and failing.

When you create a Sandbox user, make sure you don't under any circumstances sign in unless it's through your app requesting it via an IAP. There's some weird thing with Sandbox accounts that makes them invalid if you do anything else with it. Read more about it here - http://stackoverflow.com/questions/1...inapp-purchase