iPhone SDK: In-App Purchases

iPhone SDK: In-App Purchases

Tutorial Details
  • Technology: iPhone SDK
  • Difficulty: Advanced
  • Estimated Completion Time: 1 - 2 hours

This iPhone SDK tutorial is the first in a multipart series on selling products and services “in-app” with the Store Kit framework. Expect to learn the benefits and limitations of using the In App Purchase feature, the steps necessary to register paid “in-app” content with Apple Inc., how to setup a simple store front, and the difference between the Built-In Product Model and the Server Product Model for content distribution and order fulfillment.

1. Prequalify Your Content

One of the most powerful features released with the iPhone SDK 3 is the ability to process “in app” purchases. Because the App Store handles payment authorization and processing on your behalf, this feature makes selling virtual goods or services significantly easier as developers are able to focus on creating and selling great content instead of more traditional e-commerce tasks like encrypting and storing credit card numbers or processing credit card batches. Using the in-app purchase feature will also streamline the checkout process for users as they simply need to enter their Apple username and password to authorize the transaction with their iTunes account.

Of course, these benefits come with a price tag: Apple will retain 30% of the sale, as they do on all direct App Store purchases. Choosing to utilize the App Store as your payment gateway will also require that you comply with the following business rules established by Apple:

  • No physical or real-world services allowed.
    Sorry, but groceries, t-shirts, and car washes can’t currently be sold as an in-app purchase.
  • Virtual currency is not allowed.
    Apple will not currently allow the creation of a virtual economy with a direct intermediate currency.
  • Items or services purchased within your application must be accessed and used inside your application.
    Similar to the restriction on selling real-world goods, this prevents developers from selling things like coupons or offers redeemable outside of the app.
  • No defamation, hate speech, pornography or gambling.
  • Apple has published the following list of approved categories:
  • Content
    Includes digital books, magazines, photos, artwork, game levels, game characters, and other digital content that can be delivered within your application.
  • Functionality
    Products unlock or expand features you’ve already delivered in your application. For example, you could ship a game with multiple smaller games that could be purchased by the user.
  • Services
    Allow your application to charge users for one-time services, such as voice transcription. Each time the service is used is a separate purchase.
  • Subscriptions
    Provide access to content or services on an extended basis. For example, your application might offer monthly access to financial information or to an online game portal. You should define a reasonable renewal frequency to avoid bothering users with unwelcome reminders. Be aware that you are responsible for both tracking subscription expirations and renewal billing; the App Store does not monitor subscription duration and does not offer an automatic billing mechanism.

2. Create a new Xcode project and Import the Store Kit Framework

The Store Kit Framework provides the power and functionality that you will use to develop your in-app purchases. While the framework itself does not actually authorize your user’s payments, it does act as a bridge between your application and Apple, allowing you to easily send and receive messages from the iTunes App Store.

Take a look at the following illustration from Apple Inc. to better understand this concept:

In App Purchase Request/Response Cycle

Open Xcode and create a new iPhone project, selecting “View Based Application” as the default application type. Name the application “InAppDemo” or insert a more creative title of your choosing.

In App Purchase Creating a new project in Xcode.

Right click the “Frameworks” folder in the Groups & Files pane, and select Add -> Existing Frameworks. Find StoreKit.framework and click “Add.”

In App Purchases Adding the Store Kit Framework.

To use the framework in our project, we will need to add it to our project’s view controller class. Expand the “Classes” folder and click on InAppDemoViewController.h.

Just beneath the “import UIKit” command, add this line:

#import <StoreKit/StoreKit.h>

Your application should now be able to take advantage of the Store Kit Framework functionality.

3. Register Premium Content With Apple Inc.

Each virtual product or service that you wish to sell in-app must be registered with Apple and assigned a unique product identifier. Surprisingly, these identifiers are generated in iTunesConnect, not in the Developer Program Portal.

For new applications, this presents the classic “chicken-or-egg” problem. In order to build your in-app purchase project, you need to generate product identifiers, but because product identifiers can only be created via iTunesConnect, your application must have already been submitted for publication.

The solution to this dilemma is to walk through the process of submitting your application for review by Apple, but select the “upload application binary later” checkbox when you come to the “Upload” tab. This will place your application in the “Waiting for Upload” state, which is what you want in order to avoid a formal review of your application while you are still integrating and configuring your in-app purchases.

Login to your iPhone developer account and navigate to the iPhone Provisioning Portal to begin the process of submitting a test application. If you aren’t already a member of the iPhone Developer Program, you will need to sign up here.

After logging into the Provisioning Portal, select the “App IDs” tab. Click “New App ID.”

You will need to enter a common name and a unique bundle identifier. The common name will be used to identify this App ID within the Provisioning Portal and the Bundle Identifier is a unique identifier for your actual application binary. When developing an application that will use in-app purchases, you must use a full Bundle Identifier. No “wild card” IDs are allowed.

In App Purchase Creating a new app id.

Click submit. You will be taken back to the main App IDs page.

Find your newly created App ID in the list, and then click the “Configure” link to the right of it.

On the “Configure App ID” screen, select the check box next to “Enable In App Purchase” and click the “Done” button:

In App Purchase Creating a new app id. Enabled.

You should now have a unique App ID that you can use to begin developing the in-app purchase feature with.

You will now create a test application submission, so leave the program portal and login to your iTunesConnect account at itunesconnect.apple.com.

Once in your account, select the “Manage Applications” option, then select “Add New Application” at the top left of the panel.

Walk through the screens presented for adding a new application, and be sure to select the “add application binary later” checkbox option on the “Upload” tab. In the process, you will likely need to upload a random test image for the 512×512 logo and the Primary Screenshot.

After you have completed your dummy submission, you will be taken back to the iTunesConnect application management landing page. Select the application submission you just created, and then select “Manage In App Purchases.”

To add your first item, select “CREATE NEW” from the top left button.

You will now be asked to select the bundle identifier that your in-app purchases will be associated with. Select the unique Bundle Identifier you created earlier in this tutorial and click “Continue.” If you are following the tutorial strictly, the bundle identifier to select is “com.mobiletuts.inapppurchasedemo.”

Creating new In App Purchase.

You will now be presented with a set of options for Pricing on the “Create New In App Purchase” screen. As stated in the help tool tips, “Reference Name” is for identifying your purchase offer within iTunesConnect search results and “Product ID” will be used to identify your application in iTunesConnect reports.

Apple encourages you to choose between “Content,” “Functionality,” “Services,” and “Subscriptions” when considering the possible categories for your in-app offerings, but, when it comes to actually submitting them to the store, you are forced to identify your app with one of three completely new types.

As described by Apple Inc., these types are:

  • Consumables:
    Products must be purchased each time the user needs that item. For example, services are commonly implemented as consumable products.
  • Non-consumables:
    Products may only be purchased once by users. Once a non-consumable product is purchased, it is always available on all devices associated with that user’s iTunes account. Store Kit providers support to restore non-consumable products on other devices.
  • Subscriptions:
    Share attributes of both consumable and non-consumable products. Like a consumable product, a subscription may be purchased multiple times; this allows you to implement your own renewal mechanism in your application. However, subscriptions must be provided on all devices associated with a user. In App Purchase expects subscriptions to be delivered through an external server that you will provide. You must provide infrastructure to deliver subscriptions to multiple devices.

Select the one that is applicable for your offering type or “Consumable” if following this tutorial strictly. Note that once this type is set, it cannot be changed at a later time, so choose wisely.

Next, we set the offer price, which is done by selecting a price tier rather than directly entering a value. The In App Purchase price tier system is the same as the direct purchase tier system presented when initially uploading your application, but if you want to review your options again, click on the “See Pricing Matrix” text to the right of the drop down.

Go ahead and select “Tier 1″ for the price or whichever tier matches your offering. Be sure to check the “Cleared for Sale” box, even though you aren’t yet ready to launch your application. This box must be checked in order to debug and test your code.

The “Display Detail” field-set allows you to easily control offering localization. Select the language(s) you would like to list your offering in and add your custom display name and description. A meaningful and specific description is required by Apple for review approval.

Creating new in app purchase form.

For now, you can skip the Screenshot field set as it is purely a guide for the Apple employee’s reviewing your product. Click “Save Changes” to register this offering with Apple. Repeat this process to add additional items for sale “in app.”

This tutorial will use the following generic data for our offers, but feel free to be as creative as you’d like in inserting your own:

Product 1 | Consumable | com.mobiletuts.inappdemo.1 | Tier 1
Product 2 | Consumable | com.mobiletuts.inappdemo.2 | Tier 2
Product 3 | Consumable | com.mobiletuts.inappdemo.3 | Tier 3

4. Build Your Store Front

After you have registered your premium items with iTunesConnect, you are ready to begin integrating these offers into your app. For the purpose of this tutorial, we will use a simple UITableView to display our product listing.

Go to the header file for your main application view controller, in this case InAppDemoViewController.h, and modify the code to look like this:

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>
@interface InAppDemoViewController : UIViewController
				<SKProductsRequestDelegate, UITableViewDelegate, UITableViewDataSource>
{
	NSMutableArray *productIdentifierList;
	NSMutableArray *productDetailsList;
	IBOutlet UITableView *productDisplayTableView;
}
@property(nonatomic, retain) NSMutableArray *productIdentifierList;
@property(nonatomic, retain) NSMutableArray *productDetailsList;
@property(nonatomic, retain) UITableView *productDisplayTableView;
@end

The array productIdentifierList will store the product identifiers we created in Step 3 as strings, while productDetailsList will store the localized product information provided by the App Store and actually displayed to the user.

Now go to the class implementation file, InAppDemoViewController.m, and synthesize the variables you just declared in your header file:

@implementation InAppDemoViewController
@synthesize productIdentifierList, productDetailsList, productDisplayTableView;

Uncomment the viewDidLoad function, and initialize your data source:

- (void)viewDidLoad {
    productDetailsList    = [[NSMutableArray alloc] init];
    productIdentifierList = [[NSMutableArray alloc] init];
    for (short item_count=1; item_count <= 3; item_count++) {
        [productIdentifierList addObject:[NSString stringWithFormat:@"com.mobiletuts.inappdemo.%d", item_count]];
    }
    SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:productIdentifierList]];
    request.delegate = self;
    [request start];
    [super viewDidLoad];
}

In a real-world application, we would never want to put this purchase loading code in the viewDidLoad method because it will execute in the main thread and lock the application interface briefly while retrieving the data. We use viewDidLoad here only for demonstration purposes.

Starting on line 6, we create a for loop to iterate over the number of items we want to show. Because we use a common naming schema for our product identifiers, we can create multiple items on the fly without needing to type out each identifier by hand. Note that this pattern can be enhanced further with some Internet programming: your product identifier list would ideally be loaded from an external server in order to allow you to dynamically add or remove products without pushing a new binary through the App Store each time.

Starting on line 10, we are introduced to our first Store Kit Framework object, SKProductsRequest. This object is used to send a list of product identifiers to the App Store in order to receive back a list of localized product information and accurate product pricing information. This dynamic localization and product gathering technique allows you much greater flexibility than coding these attributes in by hand.

On line 12 we set the request delegate that the Store Kit Framework will call after receiving a result. Copy and paste the following code to conform to this delegate protocol:

-(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
    [productDetailsList addObjectsFromArray: response.products];
    [productDisplayTableView reloadData];
}
-(void)requestDidFinish:(SKRequest *)request
{
    [request release];
}
-(void)request:(SKRequest *)request didFailWithError:(NSError *)error
{
    NSLog(@"Failed to connect with error: %@", [error localizedDescription]);
}

The productsRequest method is called after the list of products has been retrieved from the App Store, and we assign that list of product objects from the App Store to our productDetailsList array for later use. The other two protocol methods function as expected.

Now we move on to setting up the UITableView that will be used to display our product information. Begin by setting up your nib file in Interface Builder. Expand the “Resources” folder in the Groups & Files pane and double click the InAppViewController.xib file to open Interface Builder.

From the Library Pane, drag a UITableView object to the In App Demo View Controller window. Right click the UITableView in the window and connect the dataSource and delegate to File’s Owner. Then right click the File’s Owner and connect productDisplayTableView with the UITableView object. Save and close the nib.

Go back to your view controller implementation file, InAppDemoViewController.m.

Paste in the following lines to satisfy the UITableViewDelegate and UITableViewDataSource protocol requirements:

- (NSInteger)tableView:(UITableView *)tableView
	   numberOfRowsInSection:(NSInteger)section
{
	    return [self.productDetailsList count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView
			 cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *GenericTableIdentifier = @"GenericTableIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: GenericTableIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier: GenericTableIdentifier] autorelease];
    }
    NSUInteger row = [indexPath row];
    SKProduct *thisProduct = [productDetailsList objectAtIndex:row];
    [cell.textLabel setText:[NSString stringWithFormat:@"%@ - %@", thisProduct.localizedTitle, thisProduct.price]];
    return cell;
}

Most of this is standard code for displaying text in UITableView cells. Note, however, that we create an instance of SKProduct, thisProduct, to retrieve the product data for the current row, and that we are able to easily retrieve localized product information from the object’s data members. Refer to the official Apple SKProduct reference for more information on all the data members available.

You should now be able to compile and run your application, but there is a catch: In App Store purchases can only be tested on an actual device, so you will need to create and install a provisioning profile for this application in order to test the code.

After you have installed your provisioning profile and configured Xcode, build and run the application on your device. A basic table view with product titles is too simplistic for your real world app, but the beauty of the In App Purchase system is that the storefront skin is completely up to you. In future tutorials in this series, a more advanced interface will be created. In the meantime, stretch your creativity and use whatever design you would like to showcase your products!

5. Choose a Distribution Strategy

Before you start authorizing transactions and selling new content to your users, take a moment to think about how that new content will be delivered. The Store Kit framework will allow you to easily authorize a purchase, but you are on your own when it comes to order fulfillment. The Built-In Product Model and the Server Product Model are the two primary design patterns you can choose from to ensure your users get what they pay for.

Built-In Product Model

With the Built-In Product Model, everything a user may purchase is already included in the application when it is first downloaded. This content is locked or hidden from use until after an in-app purchase is made, at which point the offer becomes usable.

The following diagram from Apple Inc. illustrates the Built-In Product Model:

In App Purchase Built in Product Model Lifecycle

Server Product Model

In the Server Product Model, content is dynamically pushed to the user’s device at the time of purchase from a server under your control. In the Server Product Model, you must add the additional step of verifying that the transaction receipt received from the client device is valid, and you may also need to setup a mechanism for identifying your users to ensure that subscriptions and other non-consumable products can still be accessed from any iPhone OS device the purchasing user owns, and not just from the device they initially purchased the item on (this is a business requirement from Apple). You are also responsible for negotiating the network connection to transfer what may be a considerable amount of text or multimedia data.

One of the primary benefits of the Server Product Model is that it allows you to sell a very large amount of content on-demand while keeping the initial download size of your application small. It is also much faster to create and deliver new premium content to your app because you should not need to push a new application binary through the iTunes Store in order to offer new items for sale.

The following diagram from Apple Inc. illustrates the Server Product Model:

Server Product Model Cycle

As you can see, the Built-In Product Model is the simpler of the two design patterns. It is easier to implement and maintain, but lacks the power of on-demand delivery. The Server Product Model is far more complex, but allows you to create new content with greater flexibility and speed, and also to keep your application size lean by providing large downloads only as needed.

Both the Built-In Product Model and the Server Product Model will be covered in detail in future parts of this series.

Now is a a good time to consider both of these distribution models and determine which is the best fit for your application.

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.davidomoyele.com David O.

    I was just thinking about this, the app I’m working on requires an in app purchase setup, but because of

    Apple’s 30% fee I will like to see the alternatives as well.

    • http://mobile.tutsplus.com Mark Hammonds
      Author

      David,

      I definitely agree, the 30% cut can really dig into profits. I haven't worked with it yet, but Paypal is offering developers a mobile payments library (https://www.x.com/community/ppx/xspaces/mobile/mep) that works with versions for both iPhone and Android. And, of course, you can always roll your own payment system as well. ;)

      We'll see whether we can fit this into our calendar at some point in the future.

      Thanks for reading!

      Best,

      Mark H.

      • mobidev

        Do Apple App store wont have any restrictions , if we use paypal, other third party libraries for purchases.. using other than in App purchases..

      • Milen

        Yes, they do indeed. In they approval guide point 11.2 state that application that use third party payment mechanisms will be rejected.

        The enforcement is very loose (so loose you can’t tell when they will screw you based on it). I have three Apps all using my own purchasing system. After adding some new services I got cut off.

    • Jammy

      I am new in iphone development. I have one task in phone gap application in iphone. I have created one UIViewController in that phone gap application from that i want to call the values of the UIViewController in phone gap application.

      IN simple words i want to get UIViewController values in phone gap controller by the custom user plugin..

      how should i start..

      please help me..

      thx in advance.

  • Rolf

    Very interesting article!

    Handful for later apps maby!

    Thanks!

    • http://mobile.tutsplus.com Mark Hammonds
      Author

      Welcome, thanks for reading!

      • mobidev

        Any idea on how the app store guys test our inApp purchase. I would like to know any snippets of the procedure. Do they buy the in app purchase items or just the screen shot we submitted is enough. What does the screen shot implies to, is it the feature of the in-App purchase or a screen where user can buy the in-App purchase.

        Please any body can make this clear.

  • Iván

    I dont want to bother… but I do not understand why this post now. Are we not supposed to learn how to program first?

    However, interesting article for later. Thanks!

    • Aaron

      I believe that it is very important to understand the process behind it all. No point knowing how to code if you don't know what you're coding for :)

      • http://jashsayani.com Jash Sayani

        I totally agree. Its important to know How it works before you make it work.

    • http://mobile.tutsplus.com Mark Hammonds
      Author

      Hey Iván,

      For the first few weeks of launch, I've been trying to feel out our community for where people are in their development knowledge. The consensus so far seems to be that we have more beginning developers reading than intermediate or advanced, so I am going to be attempting to tailor our content towards those readers for the next few months as we grow.

      That being said, I don't want to completely abandon the intermediate or advanced readers that we do have reading, so I will be continuing to post articles that are a bit more difficult on occasion. If nothing else, hopefully these will turn into good articles for our readers to come back to and review in a few months. :)

      Thanks for reading and commenting!

      Cheers,

      Mark Hammonds

  • Marius

    Very, very good article. Thank you!

    • http://mobile.tutsplus.com Mark Hammonds
      Author

      Welcome! Thanks for the feedback. :)

  • mobidev

    Do any have idea, how do the app store guys test the inApp purchase features in the application.

    Do they buy our product .

    What do the screenshot submission for the in App purchase products implies to…..

  • antony

    Hi thanks for your great article. I followed as you said. But I got crash after sending the request

    the log message is as follows

    Thu Jul 29 15:29:02 InnovatureLabs3G com.apple.launchd[1] (UIKitApplication:com.mycompany.myapp[0x2b4e][356]) : (UIKitApplication:com.mycompany.myapp[0x2b4e]) Bug: launchd_core_logic.c:2688 (24132):10

    Thu Jul 29 15:29:02 InnovatureLabs3G com.apple.launchd[1] (UIKitApplication:com.mycompany.myapp[0x2b4e][356]) : (UIKitApplicationcom.mycompany.myapp0x2b4e]) Working around 5020256. Assuming the job crashed.

    Thu Jul 29 15:29:02 InnovatureLabs3G com.apple.launchd[1] (UIKitApplication:com.mycompany.myapp[0x2b4e][356]) : (UIKitApplication:com.mycompany.myapp[0x2b4e]) Job appears to have crashed: Segmentation fault

    Thu Jul 29 15:29:02 InnovatureLabs3G SpringBoard[27] : Application 'tester' exited abnormally with signal 11: Segmentation fault

    Thu Jul 29 15:29:06 InnovatureLabs3G /System/Library/PrivateFrameworks/iTunesStore.framework/Support/itunesstored[358] : URL: http://sandbox.itunes.apple.com/bag.xml?ix=2 Heuristics Failed, NOT PIPELINING

  • Rushil

    As an intermediate developer myself, this tutorial was just the thing I needed. I am very glad I discovered this site, and will certainty read through most of your tutorials. I can’t wait for part 2, as that was the part I was actually having trouble with before I came here.

    Thanks!
    Rushil

  • http://www.brightsolutions.de Thorsten

    Very good Tutorial. It shows everything, that I have missed in the official dokumentation from Apple. A concrete way to implement the InApp-Purchases. Thank you.

  • Eugene

    Thanks for easily understandable tutorial.
    Is InApp-Purchase available option for an individual developer?
    (ie, Do I need to set up a company?)

    Thanks

  • Saktheeswaran

    Hi,

    Very good Tutorial, In my app, While testing In App Purchase we got “Your Purchase was Successful”[Sandbox Environment]. Is it ok for Uploading InApp to the app store.
    To deliver the app to the user is we have to write any code or it will be delivered automatically.
    Please reply.

  • http://theneverstill.com/ Lucas

    This is just the kind of tutorial I was hoping to find. It is well laid out and describes the rational behind we you make certain choices. I am planning on implementing a in-app purchase system where users can pay to have ads disabled and this should help me in making that possible. Thanks!

  • http://www.raisethevillage.com Cameron

    In the 9/9/2010 update it now mentions that you can have currencies as long as they are used within the app. Do you have any more information on this by chance? (So many apps clearly have their own currencies at the moment – Farmville, We Rule, the ‘Tap’s, the ‘Storie’s – or are those not considered Economy b/c they only go one way, towards buying an item?)

  • http://www.i-smartsolutions.com/itopography Vasilis

    Nice and well written article. I have two questions, however.
    Is it possible to use paypal, as David and mobidev mentioned?
    When I charge for an in-app purchase, do I have to use the tier system that Apple has for apps or can I charge as much as I like?

    Thank you

  • TWilson

    I haven’t read all the comments or anything but I wanted to point out that this isn’t a true statement:
    “Virtual currency is not allowed. Apple will not currently allow the creation of a virtual economy with a direct intermediate currency.”

    You’re not allowed to create a virtual currency that spans several products. But you can sell for example, brains in zombie farm. Gems in Restaurant Story. Whatever in Farmville. These are all virtual consumable currencies.

    This document even talks about selling poker chips: http://developer.apple.com/news/ios/pdf/in_app_purchase.pdf

    • http://mobile.tutsplus.com Mark Hammonds
      Author

      Hi TWilson,

      Thanks for your feedback. I can see how that statement is a bit ambiguous, but it comes directly from the Apple In App Purchase Programming Guide, which states:

      “You may not offer items that represent intermediary currency because it is important that users know the specific good or service they are buying.”

  • Ry

    For me …

    In the Provisioning portal, “Enable In App Purchase ” check box is not shown

    But “Enable for Apple Push notification service” is shown..

    why the “Enable In App Purchase” is not shown…

    any help..

  • Richard Taeho Kim

    Good post.
    I am interested in this topic.

    What do you( all ) think the reason why apple don’t allow physical good.
    Maybe they are afraid that they can’t assure real good deliverd to customer. right ?

  • Mitesh

    Hi,

    I am new in iTunes store. and i have create a iphone application and i want to use apple In-App-Purchase in my application and its my first application. and i want to submit this application to apple store. but it needs minimum one paid application submitted on apple store before use In-App-Purchase. so can any one suggest how i submit my first application on apple store with in-app-purchase.

    Thanks

  • http://www.appott.com Eric Abbott

    Thank you so much! I’ve been looking for a straight-forward in-app purchase tutorial and this is the only one i’ve found. I’m hoping to make my app free to download and asking people to pay what they think it’s worth via in app payments. Still working out some of the kinks (and of course there’s the spectre of possible app rejection hanging there) but this tutorial will help me a lot! Thanks!

    &ltplug&gtthe app is called “US Tax Receipt” available now (in-app purchases coming soon!)&lt/plug&gt

    Thanks,
    Eric

  • Rohit

    Nice tutorial!
    Where should i find the further tutorials of this series???

  • Darshan Khatri

    Hello

    i tried your completed code with your app keys that you have provided but even it does not load anything in the table view.

    and even i tried replacing the same with mine and its also not displaing i am not getting what the problem

    can anyone please help

    • ike

      Great turotial!, but same problem here, nothing in the table view.

      • ike

        tutorial*

      • ike

        Ok, I’ve got this working now. My problem was that I had not the tax information setup in iTunes Connect -> Contracts, Tax and Banking. You must have the bank and tax info setup to get this working.

  • Ganesh

    Thanks for this Post.

    This is Very helpful for beginners. Please don’t break this series with this one.

    Give a Sample to Server Product Model. That will be very helpful to all. Please Do that soon as possible.

    cheers,
    Ganesh.NA

  • Sneha Patel

    i m new to iphone programming i have one query that when we request for the product what id we need to add and we make payement for the product i.e. in SKPayment part at that time what id we need to add.

  • Satyam

    This is obviously a nice tutorial.
    But I didn’t understand, with the app ID that we created, whether I’ve to create a developer profile or adhoc profile to run the app on my iphone?

    I tried creating the adhoc profile with the id created. But its saying the following error:
    Mon Jan 10 15:33:05 unknown itunesstored[5173] : MS:Notice: Installing: com.apple.itunesstored [itunesstored] (550.32)
    Mon Jan 10 15:33:10 unknown /System/Library/PrivateFrameworks/iTunesStore.framework/Support/itunesstored[5173] : URL: http://sandbox.itunes.apple.com/bag.xml?ix=2 Heuristics Failed, NOT PIPELINING
    Mon Jan 10 15:33:14 unknown ReadBook[5171] : (
    ) are the products

    I didn’t understand anything. can some one help me?

  • jim

    Help!!!!

    What does it mean if “_OBJC_CLASS_$_SKProductsRequest”, referenced from: objc-class-ref-to-SKProductsRequest in [####]ViewController.o
    : symbol(s) not found
    collect2: ld returned 1 exit status

    Hope this error doesn’t happen and end up domino effect where everyone get this error. people hated get app rejected.

    • mktutsdev

      Even though this is an old post I’ll provide the answer in case anyone still runs into this issue. The reason this error occurs is simply because the StoreKit framework has not been added to the project.

  • http://kamleshwar.com Kamleshwar

    Nice Article, really help for.

    Thanks for your effort

    Kamleshwar

  • http://www.ai-t.vn Thang

    Hi,
    I have assumption: my app has some consumer products and when user go to step 9 in Server Product Model,
    cause of any reason, user can’t connect to application server and application server can’t send the receipt to verify with apple store.
    After that, user send again to application server and application server got successful.

    Question: How to verify the receipt with apple store (the receipt maybe is expired)

    Thanks,
    Thang.

  • Daniel

    I encountered an SDK for iPhone for those who do want to sell t-shirts and other physical stuff in-app
    It took me 10 minutes to integrate it in my code
    Check out http://www.zooz.co

  • Randallto

    I am new to this iOS Dev world. Just got my first smart phone last week and it is an iPhone s4. Web app developer by day.

    There are restrictions on what you can sell with in-app-purchase, correct? I now see you can buy poker chips and play real poker. Not sure the reward is real money or prizes. It looks like real gambling to me. Are there restrictions on this if you live in an area you allow legally allowed to offer this online? Basically is there a special exception for casinos on this?
    Can a charity accept donations using in-app-purchase? A raffle?
    Where are these limits spelled out?

  • nipur

    Hello ,
    i am using Non-Renewing Subscriptions product type in my application.

    Question : If i purchase a product P1 on device D1 using the apple id A1, then i want to restore the same product P1 on device D2 using same apple id A1. Can you please describe the process of restoring Non-Renewing Subscriptions product type on multiple devices ?

    Thanks
    Nipur Garg

  • http://dhakera.com Sanjay

    Hello All,
    I have done in-app purchase in my app. I test it on sandbox environment. Now I have upload it on itune and it is approved also. But on app store also the payment process is running in sandbox environment. Please let me know how I should remove sandbox environment and run app in real environment instead of sandbox environment. Your reply will be really appreciated.

    Regards
    Sanjay
    sanjay@dhakera.com

  • http://arunjack.wordpress.com Arunjack

    How to test this application in iOS simulator. when i run and built this app in simulator , and print the products count . it returns the product counts as 0.

  • RAS

    Hi thank for the tutorial..
    but i still confuse about the server side.
    What should i do in my server side? Based on the diagram from Apple Inc. the server should send the receipt data to app store and also the server should read the returned receipt data. How?
    thank you..

  • http://www.carnationsoftware.com Rich

    Great tutorial!
    Works perfect for me to display my in-app products.

    But dumb question…
    How do I know that the transaction completed sucessfully?
    When I tap on one of my products, it does not do anything.
    I don’t want to submit to Apple until I figure that part out.

    Rich

  • maurizio

    Server Product Model is not covered yet in some tutorials?

  • Subodh Kumar

    I have to add subscription feature for my iPad application. I just want to add in app functionality. My app subscription concept is like, when user download application from itune and install on iPad. Once user try to run the application. App force user to subscribe app for monthly or yearly etc. after subscribing app for monthly or yearly then only user can use the app.

    But i am not sure how to use in app purchase in this case.

    I have seen only digital product can be used in app purchase. but i want to use my app.

    any help?

  • prasad kumar

    Great tutorial!