In-App Purchase Implementation

As we discussed, the process of making a purchase is really just two calls to the iTunes Store. We will see in this section that it really only involves a handful of classes. In our example, we will be handling most of the details of working with StoreKit and handling the UI in a single class called ExtrasController, whose header is shown in Listing 10–1.

Listing 10–1. ExtrasController.h

@interface ExtrasController : UIViewController<SKPaymentTransactionObserver, SKProductsRequestDelegate>{     GameParameters* gameParams; } @property (strong, nonatomic) IBOutlet UIButton *asteroidButton; @property (strong, nonatomic) IBOutlet UIButton *saucerButton; @property (strong, nonatomic) IBOutlet UIButton *powerupButton; ...

Get Beginning iOS 5 Games Development: Using the iOS 5 SDK for iPad, iPhone, and iPod Touch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.