Add In-App Purchase Support to the Project

Similar to what you did in Chapter 18, Using Ads to Increase Revenue, you’ll use helper files to integrate in-app purchases. You’ll also use a pre-built scene to speed up development.

Open Finder and drag the IAP folder from the resources folder into the Project Navigator; place it below the AdMobHelper.swift file, like so:

images/MonetizingYourGamesWithInAppPurchases/iap-add-group.png

Don’t forget to verify that the Copy items if needed and Add to targets options are both checked. Also verify that the option to Create groups is selected. Once confirmed, click the Finish button to add the contents of the folder to your project.

Back in Xcode, open the IAP group ...

Get Apple Game Frameworks and Technologies 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.