Defining your in-app purchases in App Store Connect.
How do you define the set of products that can be purchased in your app?.
Testing in-app purchases is daunting, complex and seems way more involved than you’d expect!Īnybody wanting to support in-app purchases faces a similar set of challenges: However, if you’ve not tackled it before, implementing and
The code we write to manage in-app purchases is critically important to the success of our apps.
Add Unit Tests for IAPHelper to the framework.
Combine the IAPDemo project and the IAPHelper framework in a Workspace.
Overview of the steps to validate a receipt.
Enable StoreKit Testing via the Project Scheme.
Present the localized product list to the user and handle purchases.
Request localized product information from the App Store.
Add your IAPHelper to the Payment Queue.
Receipt Validation (Laurent Etiemble, Objc).
Receipt Validation – Verifying a Receipt Signature in Swift (Andrew Bancroft).
Swifty Local Receipt Validator (Andrew Bancroft).
Local Receipt Validation for iOS in Swift From Start to Finish (Andrew Bancroft).
Receipt Validation Programming Guide (Apple archive but still useful).
In-App Purchases with Xcode 12 and iOS 14 With reference to new a Apple Support Document. Updated 31st December 2020Īdded notes on Support for Strong Customer Authentication transactions in the European Economic Area See IAPDemo on GitHub for an example of how to use IAPHelper. However, you do so entirely at your own risk. You may freely reuse and amend this code for use in your own apps. The source code presented here is for educational purposes. See also StoreHelper for details on implementing and testing in-app purchases with StoreKit2 and StoreHelper in Xcode 13, Swift 5.5, iOS 15.ĭisclaimer. In-App Purchase Helper, including support for on-device receipt validation (StoreKit1, Xcode 12 and iOS 14).