Time for action – creating the In-App Purchase in iTunes Connect
We'll be implementing an In-App Purchase through iTunes Connect and create a scenario in a sample application that will call a transaction. Let's create the Product ID that will be used in our In-App Purchase:
- Log in to iTunes Connect. On the home page, select Manage Your Applications. Select the application you plan to add an In-App Purchase to.
- Once you're on the app summary page, click on the Manage In-App Purchases button and then click on the Create New button in the top-left corner.
- You will be brought to a page that shows you a summary of the types of In-App Purchases that you can create. For this example, Non-Consumable is selected. We'll be creating a product that needs to be purchased only once.
- In the next page is the area where you fill in the information about the product. The information applies to consumable, nonconsumable, and non-renewing subscription In-App Purchases. Fill the Reference Name and Product ID fields for your product. The Product ID needs to be a unique identifier and can be any alphanumeric sequence of letters and numbers (for example,
com.companyname.appname.productid
).Note
Auto-renewing subscriptions require you to generate a shared secret. If you are to use auto-renewing subscriptions in your app, then on the Manage in-App Purchases page, click on the View or generate a shared secret link. You will be brought to a page to generate the shared secret. Click on the Generate button. The shared secret will display a string of 32 randomly generated alphanumeric characters. When you choose auto-renewing subscriptions, the difference from the other In-App Purchase types is that you have to choose the duration between auto-renewals of your product. For more information on auto-renewing subscriptions, go to http://developer.apple.com/library/ios/iTunesConnectGuide.
- Click on the Add Language button. Select the language that will be used for the In-App Purchase. Add a display name for your product and a short description about it. When you're done, click on the Save button.
- In Pricing and Availability, ensure that Yes is selected for Cleared for Sale. In the Price Tier drop-down menu, select the price you plan to sell your In-App Purchase for. In this example, Tier 1 is selected. In Screenshot for Review, you'll need to upload a screenshot of your In-App Purchase. If you're testing on an ad hoc build, the screenshot is not necessary. Once you're ready for distribution, the screenshot is required so that the In-App Purchase can be reviewed upon submittal. Click on the Save button when done.
- You will see a summary of the In-App Purchase that you created on the next page. Click on the Done button if all of the information looks correct.
Adding a new In-App Purchase is a very simple process. The information contained in the Product ID is what will be called upon during a transaction. Managing the type of In-App Purchase entirely depends on what type of product you want to sell in your game. This example demonstrates the purpose of taking a nonconsumable product that represents purchasing/unlocking a new level in a game. This is a common scenario for users who to want to sell level packs.
Your application does not have to be completed to test In-App Purchases. All that is required is to have your application information set up in iTunes Connect so that you can manage the features of In-App Purchase.