1. Install the SDK
- Swift Package Manager (recommended)
- CocoaPods
- In Xcode, go to your project’s Package Dependencies.
-
Click + and enter the package URL:
- Set Dependency Rule to Up to Next Major Version (recommended).
- Click Add Package, then add the Helium product to your app’s main target.
2. Initialize Helium
Initialize as early as possible in your app’s lifecycle — before any paywall is shown. Your API key is available in the Helium dashboard → Profile.- SwiftUI
- SceneDelegate
- AppDelegate
3. Show a Paywall
Before callingpresentPaywall, make sure you have a trigger and workflow configured in the Helium dashboard.
Recommended Setup
The following steps are optional but strongly recommended for production apps.Identify Users
User identification is optional. It improves targeting accuracy and event attribution in external analytics. If you’re unsure whether you need it, you likely don’t — but it’s easy to add. Identify users before callingHelium.shared.initialize to ensure consistency from the first session.
Using appAccountToken
Using appAccountToken
If your app uses an
appAccountToken for purchases, share it with Helium so it can be applied to paywall purchases.Paywall Events
Helium emits events throughout the paywall lifecycle. You can handle them per-presentation or globally.Per-presentation handlers
Pass aPaywallEventHandlers instance when calling presentPaywall:
Global event listener
Use a global listener to handle events across all paywalls without passing handlers at each call site.Important: Listeners are held weakly. If you don’t keep a strong reference to your listener object, it will be deallocated immediately and no events will fire.
Fallback Paywalls
Set up fallbacks to handle the rare case where a paywall fails to load. This is strongly recommended before going to production. Follow the fallback bundle guide once you have a production paywall ready.Checking Entitlements
Check entitlement status before showing a paywall to avoid showing it to users who are already subscribed.All Entitlement Methods
All Entitlement Methods
Advanced
RevenueCat Integration
By default, Helium manages purchases directly. If you’re already using RevenueCat, use theHeliumRevenueCat package instead to keep RevenueCat in control.
Install HeliumRevenueCat
- Swift Package Manager
- CocoaPods
- In Xcode, go to Package Dependencies.
-
Click + and enter:
- Add the HeliumRevenueCat product to your app’s main target.
Configure
Set theRevenueCatDelegate before calling Helium.shared.initialize:
If you omitrevenueCatApiKey, initialize RevenueCat yourself before instantiatingRevenueCatDelegate.
Keeping appUserID in sync
If youchange the RevenueCat appUserID, sync the value to Helium:
Custom Purchase Handling
By default, Helium handles purchases for you. This section is for apps that need custom purchase logic.Tip: If you only need to augment the built-in logic, subclassTo fully replace purchase handling, implementStoreKitDelegateorRevenueCatDelegateand callsuperon any methods you override.
HeliumPurchaseDelegate:
Additional Methods
Check Download Status
Check Download Status
In most cases you don’t need this — Helium shows a loading indicator automatically if the paywall hasn’t finished downloading.
Get Paywall Info by Trigger
Get Paywall Info by Trigger
Use this to verify a paywall is ready before attempting to display it.
Hide Paywalls Programmatically
Hide Paywalls Programmatically
Reset Helium
Reset Helium
Resets Helium so
initialize can be called again. Useful after changing user traits that affect paywall targeting.