iOS Setup
Live Activities
Requires SDK version 4.13.0 or later Requires iOS 18.0 or later
This guide walks you through setting up Live Activities in your iOS app to display real-time sports scores and updates on the lock screen and Dynamic Island.
What are Live Activities?
Live Activities are a feature introduced in iOS 16 that displays real-time, glanceable information on your iPhone's lock screen and in the Dynamic Island on iPhone 14 Pro and later. They provide persistent updates without requiring users to unlock their device or open your app.
For sports apps, Live Activities are ideal for displaying:
- Real-time game scores as they update
- Game clock and current period/quarter
- Team logos and colors
- Recent plays or game events
Rover's Live Activity implementation uses a push-to-start architecture, meaning the Rover platform can remotely start Live Activities on users' devices when a game begins, and send real-time updates throughout the game via Apple Push Notification Service (APNs).
The Live Activity will automatically appear when a game starts (triggered by a Rover campaign) and persist on the lock screen until the game ends or the user dismisses it.
What's Included
Each Rover Live Activity module includes:
Pre-configured Team Assets
- Team logos for all teams in the league (NBA: 30, NFL: 32, NHL: 32)
- Team primary brand colors
- All assets are bundled with the module - no additional configuration needed
Dynamic Island Support
- Compact view showing both team logos and scores
- Expanded view with detailed game information
- Minimal view for when multiple activities are running
Lock Screen Widget
- Full game information display
- Live score updates
- Game phase and clock information
Automatic Updates
- Score updates pushed from Rover campaigns
- Real-time clock countdown
- Game phase changes (pregame, playing, halftime, final)
Choose Your League Module
Rover provides three pre-built Live Activity widgets for live sports scores:
- RoverNBALiveActivities - NBA games with all 30 team logos and colors
- RoverNFLLiveActivities - NFL games with all 32 team logos and colors
- RoverNHLLiveActivities - NHL games with all 32 team logos and colors
iOS Version Requirements
Rover Live Activities require iOS 18.0 or later for full push-to-start functionality.
Install the SDK Modules
Add the Live Activities modules to your app's main target.
In your target's "Frameworks and Libraries" section, click the "+" button and add the following from the Rover package:
- RoverLiveActivities (required for all Live Activities)
- One league module - Choose the one that matches your app's sport:
RoverNBALiveActivitiesRoverNFLLiveActivitiesRoverNHLLiveActivities
Create a Widget Extension
Live Activities are displayed through a Widget Extension, which is a separate target in your Xcode project.
Add Widget Extension Target
- In Xcode, select File → New → Target...
- In the template chooser, search for "Widget" and select Widget Extension, then click Next
- Configure the widget extension:
- Product Name: Something like "LiveActivityWidget" or "[YourApp]Widget"
- Include Live Activity: Checked
- Include Control: Leave unchecked (not needed)
- Include Configuration Intent: Leave unchecked (not needed)
- Click Finish
- When prompted "Activate 'LiveActivityWidget' scheme?", click Activate
Add League Module to Widget Extension
The Widget Extension needs access to your chosen league module.
In the Project navigator, select your project, then select the Widget Extension target
Go to the General tab and scroll to Frameworks and Libraries
- Click the "+" button and add your sport-specific module:
- For NBA: Add
RoverNBALiveActivities - For NFL: Add
RoverNFLLiveActivities - For NHL: Add
RoverNHLLiveActivities
- For NBA: Add
Configure the Widget Bundle
Open the main Swift file in your Widget Extension (it should be named something like LiveActivityWidget.swift or LiveActivityWidgetBundle.swift).
Replace the entire contents with this code, using the import and widget for your league:
import SwiftUI
import WidgetKit
// Use the import for your league:
// import RoverNBALiveActivities
// import RoverNFLLiveActivities
// import RoverNHLLiveActivities
@main
struct LiveActivityWidgetBundle: WidgetBundle {
var body: some Widget {
// Use the widget for your league:
// RoverNBALiveActivity()
// RoverNFLLiveActivity()
// RoverNHLLiveActivity()
}
}
Widget Bundle Cleanup
You can delete any other generated files in the Widget Extension target (like configuration intent definitions or example widgets) - they're not needed for Rover Live Activities.
Initialize Rover Live Activities
In your app's main initialization code (typically in your App struct or AppDelegate), add the LiveActivityAssembler to your Rover initialization.
Rover.initialize(assemblers: [
FoundationAssembler(),
DataAssembler(accountToken: "YOUR_SDK_TOKEN"),
// ... other assemblers
LiveActivityAssembler() // Add this line
])
}
Enable Broadcast Notifications
Live Activities use a special type of push notification called "broadcast" notifications to start and update activities remotely. You need to enable this capability in the Apple Developer Portal.
Configure in Apple Developer Portal
Go to Certificates, Identifiers & Profiles in the Apple Developer Portal
In the Identifiers section, find and select your app's App ID (Bundle Identifier)
Scroll down to Push Notifications and click Configure (or Edit if already configured)
Enable Broadcast Capability
Click Save
Required for Live Activities
Without broadcast capability enabled, Rover cannot remotely start Live Activities on your users' devices. This is a common setup issue - if Live Activities aren't appearing, verify this setting first.
Register Live Activities
After initializing Rover with LiveActivityAssembler, you need to register which Live Activity types your app will use. This enables Rover to track push-to-start tokens and send them to the server.
Add this registration code after Rover initialization, typically in your app's initialization:
import RoverLiveActivities
// Use the import for your sport:
// import RoverNBALiveActivities
// import RoverNFLLiveActivities
// import RoverNHLLiveActivities
// After Rover.initialize(...)
// Use the attributes type for your sport:
// RoverNBAActivityAttributes, RoverNFLActivityAttributes, or RoverNHLActivityAttributes
Rover.shared.liveActivities.registerLiveActivity(
attributes: RoverNBAActivityAttributes.self,
name: RoverNBAActivityAttributes.activityName
)
This registration call sets up monitoring for push-to-start tokens, which are automatically sent to Rover's servers so campaigns can remotely start Live Activities for your users.
Enable Live Activities
To ensure that Live Activities function correctly your main app must declare support for Live Activities. Enable Live Activities by adding the configuration key to your app's Info tab.
Set 'Supports Live Activities" to YES in the Info tab of the target settings
- In Xcode, select your project in the Navigator, then select your app target
- Select the Info tab
- Hover over any existing key and click the "+" button to add a new entry
- Add the following key-value pair:
- Key:
Supports Live Activities(orNSSupportsLiveActivities) - Type: Boolean
- Value:
YES
- Key:
Configure Frequent Updates
The Rover Live Activity requires frequent updates to ensure score is up to date play by play. Enable frequent updates by adding you need to add a configuration key to your app's Info tab.
Set 'Supports Live Activities Frequent Updates" to YES in the Info tab of the target settings
- In Xcode, select your project in the Navigator, then select your app target
- Select the Info tab
- Hover over any existing key and click the "+" button to add a new entry
- Add the following key-value pair:
- Key:
Supports Live Activities Frequent UpdatesorNSSupportsLiveActivitiesFrequentUpdates - Type: Boolean
- Value: YES
- Key:
This setting allows your Live Activities to receive score updates as frequently as needed during active games, ensuring users see changes in near real-time.
Update Frequency
Without this setting, Live Activities are limited in how often they can receive updates. Enabling frequent updates ensures your users see score changes as soon as they happen during live games.
Testing Your Integration
Build and Run
Select your main app scheme (not the Widget Extension scheme) in Xcode
Build and run your app on a physical device running iOS 18.0 or later
- Live Activities cannot be tested in the iOS Simulator
The app should launch without errors
Physical Device Required
Live Activities cannot be tested in the Simulator. You must use a physical iPhone running iOS 18.0 or later.
Verify Widget Extension
- Stop your app
- Select your Widget Extension scheme from the scheme selector
- Click Run
- When prompted to choose an app to run, select your app
- The app should launch and the debugger should attach to the widget extension
If the extension builds and runs without errors, your setup is correct.
Testing with Live Games
When the league integration is enabled in your Rover portal, Live Activities will appear on your devices when a game for your team is in progress.
Live Game Requirement
Unlike some features that can be tested immediately, Live Activities are triggered by campaigns during actual sporting events. Coordinate with your team to configure test campaigns around scheduled games.
Troubleshooting
"To use Rover Live Activities support you must add LiveActivityAssembler"
This error means you haven't added LiveActivityAssembler() to your Rover.initialize() call. Make sure it's included in the assemblers array.
Widget Extension not showing Live Activity
Make sure you've:
- Added the correct league module to your Widget Extension target under Frameworks and Libraries
- Imported the correct module in your WidgetBundle file
- Added the correct widget to the bundle (e.g.,
RoverNBALiveActivity())
Live Activities not appearing on device
Verify:
- You're running on a physical device (not Simulator)
- Device is running iOS 18.0 or later
- Push Notifications capability is enabled
- APNs credentials are configured in Rover dashboard
- You've registered the Live Activity type in your app code
- A campaign is active and configured for a live game
- The game is currently in progress or about to start