Add the PurchaseKit Swift package to your Hotwire Native iOS app.
Add the package via Swift Package Manager in Xcode:
https://github.com/purchasekit/purchasekit-ios

In your app's setup code, register the PaywallComponent with Hotwire Native:
import HotwireNative
import PurchaseKit
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Hotwire.registerBridgeComponents([
PaywallComponent.self
])
return true
}
}
That's it! The component automatically:
PurchaseKit automatically detects whether the app is running in sandbox or production:
| Build type | Environment |
|---|---|
| Simulator | sandbox |
| Development build | sandbox |
| TestFlight | sandbox |
| App Store | production |
This ensures sandbox purchases don't accidentally get treated as production (and vice versa).
Create your subscriptions in App Store Connect.