Overview
Helium’s event handling system has native handlers for most common paywall events (purchases, navigation, etc), but in some cases you might want to have custom interactions on your paywall that aren’t handled by default. For example, you might want to have a toggle that when selected sends a trial notification reminder using your own notification system. Helium lets you do this with Custom Events.Custom Events
A custom event is fired from the paywall and handled from the SDK. You can have as many different types of custom events as you want within a single paywall. Custom events have a few properties: Action Name - (String) The name of the event. For example, “did_switch_trial_toggle” Params - (Dictionary of string keys -> any type of value) Dictionary of arbitrary parameters associated with the action. The keys have to be strings, the values can be numbers, boolean, strings, arrays, or dictionaries themselves. For example,- a trial notification toggle
- a little survey that you ask the user within the paywall
- a custom dismiss button
Editor: Add a button that emits a custom action to your paywall
In the Helium paywall editor, you can add a button or interaction that sends a custom action by just asking the chat. For example,- Add a trial reminder toggle using custom actions.
- Add a button that triggers requesting permissions for location if a user press an opt in button.
- Make it so that if the user selects the Watch Ads button, the editor sends a custom action to handle so that the SDK can handle that case on purchase pressed ”
- You can verify the editor is using a custom action using the Actions Panel.
- Feel free to tell the editor the specific action name and params you want it to use!
- Reach out to support with your use case - happy to set this up for you and tell you what the corresponding SDK code should look like to handle the new event!
SDK: Add an onCustomPaywallAction handler
Then, within your SDK you can use Paywall Event Handlers with theonCustomPaywallAction event. Visit our SDK’s quickstart pages for more info on getting set up with the SDK.
- iOS
- Android
CustomPaywallActionEvent contains:actionName: The action nameparams: Dictionary of parameterstriggerName: The trigger that opened this paywallpaywallName: The name of the paywalltimestamp: ISO timestamp for when the event occurred