Apple released the fourth preview of iOS 16 and Co. on Wednesday evening. The API for the Live Activities feature on the new lock screen has now been added.
Although Apple has already announced that this feature will not be available in version 16.0, something has changed with Beta 4: The Live Activities API is now available for developers to test. Since the framework is now available Apple has also released documentation on how to view live data on the lock screen with Live Activity on iOS 16.
Live Activities display and update an app's most recent data on the iPhone lock screen, allowing users to see the live information they're most interested in at a glance. To offer Live Activities, add code to your existing widget extension, or create a new widget extension if your app doesn't already have one. Live Activities use WidgetKit features and SwiftUI for their UI on the lock screen. ActivityKit's job is to manage the lifecycle of each Live Activity: you use its API to request, update, and end a Live Activity.
In iOS 16, a live activity can remain active for up to eight hours unless the app or user explicitly ends it. After this period, the system automatically ends a live activity unless the user or app has already ended it.
iOS 16: How Live Activities Work
In this final state, the live activity will remain on the lock screen for up to four more hours before the system removes it. Users can also remove it themselves. A live activity will therefore remain on the lock screen for a maximum of 12 hours. Each live activity runs in its own sandbox and, unlike a widget, cannot access the network or receive location updates. To update the dynamic data of an active live activity, developer use the ActivityKit framework in their app or allow their Live Activities to receive push notifications remotely. Apple showed during the WWDC 2022 keynote that Live Activities can work for an Uber ride or to see if your Starbucks order is ready. Whether your device is compatible with the new software, you can find out here. (Image: Apple)