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.
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.
If you are not already using OneSignal in your iOS app, follow the steps in our Mobile Quickstart.
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.
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.
- 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 ⚠️
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.
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:
Live Activities use WidgetKit functionality and SwiftUI for their user interface. Read Apple's Guide Displaying live data with Live Activities.
Read our Guide on How to Create and Update iOS Live Activities.
Updated 4 months ago