In-App Purchase Product Identifiers

In-App Purchase Product Identifiers

Q:
I am implementing In-App Purchase and must register my product identifiers. What are product identifiers and how do I create and use them in my application?

A: A product identifier is a string used to uniquely identify every product you wish to sell from your application. The App Store uses it to retrieve information about a product. It is a string identifier that can only contain alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.) characters. You can use any sequence of these characters for your identifier. However, we recommend that you use the reverse domain name style (for example, com.companyname.application.productid) when creating your identifier.

Note: Product identifiers are not related to your App ID or Bundle ID. They may look like Bundle IDs, but they are not equivalent to them. Hence, you should not use your App ID or Bundle ID in lieu of your product identifiers in your code.

How do I create a product identifier?

The In-App Purchases form is used to generate In-App Purchase products. It contains a Product ID field that must be filled. Use this field to specify the product identifier for your product. Follow the steps below to create a product identifier:

Log in to iTunes Connect, then navigate to the Manage Your Applications module present in the home page.

iTunes Connect takes you to the Manage Your Apps page, which contains a list of all your applications. Select the application for which you want to create In-App Purchase products, then click on the Manage In-App Purchases button in the ensuing page for this application, then on the Create button in the next page.

Select a type for your In-App Purchase product. iTunes Connect takes you to the In-App Purchases form, which contains a Save button. Fill out the Product ID as well as all the other fields present in that form.

Important: You cannot edit a product identifier after you have created it. Furthermore, you cannot reuse product identifiers for products that have been rejected during App Review.

Figure 1 displays the com.apples.mygreatapp.consumable1 and com.apples.mygreatapp.sport7days product identifiers for the My Great App application.

How do I use a product identifier in my application?

You create an SKProductsRequest object, then pass your list of product identifiers to its initWithProductIdentifiers method to retrieve information about your products. See Listing 1 for an example that requests information about the products associated with the product identifiers shown in Figure 1.