Overview
The event system lets you react to presentation lifecycle events like shown, dismissed, and converted. Events flow through event handlers that you register with Presentum. Each handler can perform actions like recording to storage, sending analytics, or triggering business logic.Built-in events
Presentum provides three core events:PresentumShownEvent
Fired when a presentation is displayed to the user
PresentumDismissedEvent
Fired when a user dismisses a presentation
PresentumConvertedEvent
Fired when a user takes action on a presentation
Event structure
All events extendPresentumEvent and include:
PresentumShownEvent
PresentumDismissedEvent
PresentumConvertedEvent
Event handlers
Create handlers by implementingIPresentumEventHandler:
Built-in storage handler
PresentumStorageEventHandler automatically records events to storage:
Register handlers
Add handlers when creating Presentum:Trigger events
Events are automatically triggered when you call:Custom events
Create your own events by extendingPresentumEvent:
Production example
Here’s a complete event handling setup from a production app:Event handler patterns
Logging handler
Backend sync handler
BLoC integration handler
Best practices
Keep handlers fast
Keep handlers fast
Event handlers run synchronously. Avoid slow operations.Bad:Good:
Use PresentumStorageEventHandler
Use PresentumStorageEventHandler
Always include the storage handler to record events: