Managing Live Activities locally
Live Activities are dynamic interfaces that display real-time information on iOS devices. Voltra provides a comprehensive set of APIs for managing the complete lifecycle of Live Activities directly from your React Native app, without requiring server-side infrastructure.
Voltra offers both imperative APIs for direct control and React hooks for seamless integration with your components.
This page documents the legacy server-rendered engine. For the separate experimental engine that bundles a definition with the app and updates it with props, see Dynamic Live Activities.
Imperative APIs
The imperative APIs provide direct, programmatic control over Live Activities. These are the core functions you'll use to manage Live Activity lifecycles. For the shape of the variants object used below, see Supported variants.
Starting Live Activities
Use startLiveActivity() to create and display a new Live Activity.
Parameters:
variants: ALiveActivityVariantsobject defining the UI for different display contextsoptions: Configuration options (see Configuration Options section below)
Returns: A promise that resolves to the Live Activity ID (string)
Updating Live Activities
Use updateLiveActivity() to modify the content and configuration of an active Live Activity.
Parameters:
activityId: The ID returned fromstartLiveActivity()variants: Updated UI variantsoptions: Updated configuration options
Stopping Live Activities
Use stopLiveActivity() to end a Live Activity.
Parameters:
activityId: The ID of the Live Activity to stopoptions: Final configuration options
Checking Live Activity status
Use isLiveActivityActive() to check if a specific Live Activity is currently active.
Parameters:
activityName: The name of the Live Activity to check (same asactivityNameused when starting the activity)
Returns: Boolean indicating whether the Live Activity is currently active
Utility functions
Platform detection
Voltra also exposes useIsHeadless() for detecting when your app was launched in the background (e.g. to handle a push token refresh without mounting your UI). See Handling background execution for the full explanation and example.
Ending all Live Activities
Use endAllLiveActivities() to immediately end all active Live Activities in your app.
Note: This function ends all Live Activities immediately without applying any dismissal policies. Use this for bulk cleanup scenarios rather than individual activity management.
Development tools
For development-friendly APIs that provide automatic updates and easier testing, see the Development documentation.
Event handling
Live Activities emit events that you can listen to for state changes and user interactions. See the Events API documentation for detailed information on subscribing to and handling Live Activity events.
Configuration options
Voltra provides several configuration options to control Live Activity behavior, lifecycle, and appearance. These options can be used with startLiveActivity(), updateLiveActivity(), and stopLiveActivity().
Dismissal policy
Controls how Live Activities behave after they end.
Options:
'immediate'(default): Live Activity is dismissed immediately when it ends{ after: number }: Live Activity remains visible for the specified number of seconds after ending, then automatically dismisses
Examples:
The dismissal policy applies to both programmatic ending and natural ending (when timers expire).
Stale date
Specifies when a Live Activity should be considered stale and automatically dismissed by iOS.
Note: If you provide a staleDate in the past, it will be ignored.
Relevance score
Helps iOS prioritize which Live Activities to display when space is limited.
Range: 0.0 to 1.0 (default: 0.0)
Live Activities can receive updates even when your app is in the background or terminated, but they cannot execute JavaScript code. For real-time updates from backgrounded apps, use server-side push notifications.
Channel ID (broadcast push, iOS 18+)
Subscribes the Live Activity to a broadcast channel for server-side updates. When provided, the activity receives updates via broadcast push notifications instead of individual device tokens—one server notification updates all activities on that channel.
Requires enablePushNotifications: true in the Voltra plugin and the Broadcast Capability enabled in your Apple Developer account. See Server-side updates for details.
Best practices
- Provide an
activityNamewhen starting a Live Activity, so you can re-bind to it (e.g. viaisLiveActivityActive) after an app restart. - Set a
staleDateso iOS can automatically dismiss activities you forget to end (e.g. after a delivery is likely already complete). - Provide a
deepLinkUrlso tapping the Live Activity takes users somewhere useful in your app. - Pick a
dismissalPolicydeliberately —{ after: N }is useful when you want users to see a final state (like "Delivered") before it disappears.
