Skip to main content

Overview

Most of the time you’ll want to use presentPaywall() (or presentUpsell() depending on your SDK version) to show paywalls. This approach is covered in each platform’s quickstart guide (see navigation menu on the left). But if you need more control over how and where paywalls appear in your app, there are a few other options.

iOS

Embedded View

The iOS SDK will attempt to handle dismissal for embedded views but may not be able to depending on where you place it. You can dismissal yourself with PaywallEventHandlers.
customPaywallTraits are captured when the paywall displays and then stay fixed for that presentation. In SwiftUI this is handled for you as long as the traits come from state that re-renders the view. This is the normal way you’d pass dynamic values into a view.When you host HeliumPaywall in UIKit with a UIHostingController, UIKit won’t refresh the view for you. If you build the hosting controller ahead of time and update traits before showing it, drive the view from an ObservableObject so the latest traits reach the paywall before display:
This applies before the paywall is on screen. Once displayed, traits are locked for that presentation. Updating the store afterward won’t change an already-shown paywall.

SwiftUI ViewModifier

Attach a paywall to any SwiftUI view using the .heliumPaywall view modifier:
If you are using UIKit, you can use a UIHostingController.

Android

Embedded Paywall (Compose)

Make sure to add com.tryhelium.paywall:compose-ui:4.0.0 to your dependencies.

Flutter

Widget Integration

Flutter embedded widget currently only works for iOS. Android support is in the works.
Embed a paywall directly in your widget tree using HeliumFlutter.getUpsellWidget:
You will have to handle your own dismissal. You can do so by passing in PaywallEventHandlers and using the onDismissed handler.