Monetize your iOS apps with StoreKit 2! 🚀 In this SwiftUI tutorial, we’ll build a quick demo app featuring both a non-consumable in-app purchase (IAP) and a subscription. You’ll learn how to integrate StoreKit 2 in Xcode, test everything locally and tips for using Sandbox/TestFlight.
👉 Perfect for unlocking Pro features, premium subscriptions, or consumables in your apps.
🤔 We’ll cover:
Setting up StoreKit 2 in SwiftUI
Non-consumable purchase flow
Non-renewable subscriptions
Entitlement checks
App Store Connect setup (IAP, Subscription, metadata)
Testing IAPs with StoreKit Config locally
🖼 Try It Yourself!
Clone or download the full demo project here:
📁 Demo Template: https://github.com/NDCSwift/StoreKitDemo
📁 Advanced Template: https://github.com/NDCSwift/StoreKit2...
🔥 Download My Project Files & More! 🔥
👉 Get the source code for this project & other Swift resources here:
🔗 https://ndcswift.github.io/Swift-Proj...
⏱️Timestamps
00:00 - Intro & Sample App
01:40 - Project Creation
02:20 - Enable In-App Purchases
02:44 - Adding app to Appstore connect
03:35 - Creating In App Purchase on Appstore Connect
06:46 - Syncing StoreKitConfig with Appstore Connect
07:28 - StoreKitConfig Without Appstore Connect
08:44 - Creating Subscription on Appstore Connect
09:47 - Including StoreKitConfig in runtime for local testing
10:22 - Tips for testing on Sandbox
10:04 - Creating a StoreModel for In-App Purchases
14:18 - Loading Product
15:30 - Handling Purchasing
17:03 - Entitlement Check
19:00 - Transaction Listener
20:35 - Wiring purchase to a button
23:30 - Testing IAP on Simulator
24:10 - Enable Sandbox testing (Non local testing)
25:00 - Creating Sandbox Account
25:23 - Creating Subscription Store model
26:52: - Update Sub Status
28:10 - Wiring Sub to a button
29:30 - Testing subscription on Simulator
30:32 - Checking Product purchase status on other views
32:49 - Wrap up & Projects in description for download