Live Activities Quickstart
How to set up Live Activities on your iOS Mobile App with OneSignal
Live Activities are an iOS feature introduced in October 2022 for displaying live information via a widget that is shown on the device lock screen and in the dynamic island (when available). They are intended to display data that changes during a time window, such as sports scores, delivery statuses, and other real-time transactional updates.
OneSignal is the easiest way to implement support for iOS Live Activities in your application. We take care of helping you start, update, and end live Activities, as well as:
- Managing the temporary push tokens associated with Live Activities
- Updating all active live activities with a single API call for up to tens of millions of devices
- Providing real-time analytics on your delivery of Live Activities and how users are engaging with them
- Powering your other user engagement channels, such as Push Notifications, Email, SMS, and In-App Messaging
- An iOS Application (Live Activities are only available on the iPhone).
- Ensure you are using a .p8 key. Check out our guide, iOS: Establishing a Token-Based Connection to APNs (.p8 Key), if migrating away from a .p12 certificate.
- Live Activities available on iOS 16.1+ or newer, which is supported on iPhones made in 2017 or newer.
Step 1. All iOS SDK Setup Docs
If you are already using OneSignal, you may need to update to a new SDK version before using Live Activities. You can use the table below to select the SDK type you need to get started.
Step 1A. Add OneSignal SDK
If you are not already using OneSignal in your iOS app, follow the steps in our Mobile Quickstart.
Step 1B. Ensure you are using the latest version of the OneSignal SDK
For those who need to update the OneSignal SDK to the latest version, there are two methods: one for updating SPM and one for updating CocoaPods.
|SDK||SDK Release Version needed for Live Activities|
|Objective-C or Swift||3.12.3+|
|Unity SDK Setup||4.5.0+|
|React Native & Expo SDK Setup||4.5.0+|
|Flutter SDK Setup||3.5.0+|
|Ionic & Capacitor SDK Setup||3.3.0+|
|Cordova SDK Setup||3.3.0+|
|Xamarin SDK Setup||4.3.0+|
|.NET SDK Setup||4.3.0+|
Step 1C. Update via Swift Package Manager
Find “Package Dependancies” in the file explorer tab in Xcode. Lock the OneSignal-XCFramework Dependency. Right-click on the OneSignal-XCFramework Dependency and select Update Package.
Step 1D. Update via CocoaPods
- Run pod update OneSignalXCFramework
- Confirm update by checking the version of OneSignalXCFramework in Podfile.lock
💡 Note: If the pod was not updated in PodFile.lock open the Podfile and make sure that it matches these instructions.
⚠️ Now OneSignal SDK version 3.12.3 or higher has been added to the iOS project ⚠️
Step 2. Add a Live Activity Widget Extension to the iOS project
File > New > Target...
Select Widget Extension
Name the Widget extension, make sure to check “Include Live Activity”. By doing this,Widget Extension Target has been added.
Step 3. Configuration
Locate the info.plist in the main target add the key “Supports Live Activities” and set it to Yes
This adds to the info.plist file is as follows:
Step 4. Displaying live data with Live Activities
Live Activities use WidgetKit functionality and SwiftUI for their user interface. Read Apple's Guide Displaying live data with Live Activities
Step 5. Send Yourself a Live Activity
Read our Guide on How to Create and Update iOS Live Activities
Updated 3 months ago