In this article we are going to talk about In-App Purchase. The freemium model seems to be very successful in the App Store these days so if you’re thinking of implementing it, read on. Before you even think about code there are a few things you need to setup in iTunes Connect. We’ll go through each step and by the end of this article you should have an app that allows In-App Purchase and the product that you want to buy.
The first thing you need to do is decide what kind of product do you want to sell through In-App Purchasing. There are 5 types of IAP products:
- consumable – used one time after which they become depleted and need to be purchased again, e.g. extra live in a game
- non-consumable – purchased once and do not expire or decrease with use, e.g. new treasure maps in a game
- auto-renewable subscription – allows user to purchase dynamic content that expires after a period of time, the subscription will automatically renew unless the user opts out
- free subscription – are a way for developers to put free content in the Newsstand in the App Store, free subscriptions do not expire
- non-renewing subscription – allows the sale of items with a limited duration
We are going to create a photo app that allows the user to buy more photos through In-App Purchase. This means we will need to setup a non-consumable product for our app. Let’s dive in.
Create App ID
First let’s create an App ID for this app. Let’s go to the iOS Dev Center and select Identifiers and then App ID’s:
Click the + button to add a new App ID. Enter the name:
Then select Explicit App ID and enter a bundle ID:
In the App Services section make sure that In-App Purchase is selected and click Continue. Double check that In-App Purchase is enabled for your app:
Submit this and you have your App ID!
Create new app in iTunes Connect
Log into iTunes Connect, go to My Apps and create a new iOS app. Fill in all the required details and make sure you select the bundle ID of the app we have just created. You need to find a unique name for your app. I’ve called my app “Vasy’s Photos”. You won’t be able to use the same name so be inventive and find something that’s unique.
Create new In-App Purchase product
After we’ve created the app there are lots of information that we can setup for it, but right now we are only interested in setting up a non-consumable In-App Purchase product. So let’s go to the In-App Purchase section for your app and press “Create new”.
We are presented with all the types of product and we need to select the one appropriate for our case. As you can see there is a nice description for each of the product types and a link to find out more about selling products with In-App Purchase, so feel free to explore and learn more about the other kinds of products. We have already established that we need a non-consumable product so let’s select it and go to the next page.
On this page we need to enter a reference name. This only shows up in iTunes Connect, so it can be whatever you want.
Next we need to setup a product identifier. This is the unique string that will identify your product. I’ve composed this identifier from the app bundle id and a string that describes the product.
You also need to select if the product is Cleared for sale or not. I’ve selected Yes, which means that this product will be available for the users to buy as soon as the app is released. You also need to select a price for your product so make sure you check the price matrix and choose the appropriate tier. For our example we just use Tier 1.
This is how things should look like up to now:
There is another section with In-App Purchase details that we need to fill in. First you need to add a language:
This is where you add info that is actually visible to the users, so proceed with care and take the time to come up with a nice name and a good description for what this product offers. Apple suggests you should make it clear to the users what they are getting from this product and that will also help users decide whether to buy it or not. You could have this information hard coded in your app, but the product name and description are sent to you when retrieving available In-App Purchase products from your app. If you don’t hard code it you can change it in iTunes Connect and the app will get the updated info.
After you have selected a language you need to decide if you want to host the content on Apple’s server or on your own server. It’s nice and easy to host your content on Apple’s server, but there might be good reasons why you prefer not to, so this one is up to you. We are going to leave this as No right now. If you select yes then you need to configure and upload the content to the Apple’s server before the product will be “Ready to submit”. If the status is something different then it might not be in the list of products that are retrieved when you make the call from the app.
Review notes are optional and we don’t have a reason to include them now. And finally we need a screen shot for review. You can just take a screen shot of a new app in the simulator or select any file that is at least 640×920 pixels and 72 DPI.
This is it, you now have a product configured in iTunes Connect.
If the status of your product is not “Ready to submit” or if you have never used In-App Purchase before for any other apps then you will need to enter some legal information before things will work out properly. Usually there is a warning about this when you look at your product. You can also go to “Agreements, Tax and Banking” in iTunes Connect and make sure that in the “Contracts in Effect” you have one for “iOS Paid Applications”. You will need to enter info in all three categories: “Contact Info”, “Bank Info” and “Tax Info” and wait until it is approved.
Once the status of your product is “Ready to submit” you can now proceed to the next step and start writing some code. We will talk about this in part two of this tutorial, so stay tuned!
Pingback: In-App Purchase – How to retrieve the list of products from the App Store | Mastering iOS
Pingback: In-App Purchase – How to implement the payment transaction | Mastering iOS