# Experimenting with Live Activities

DevFeed: [Experimenting with Live Activities](<https://devfeed.tech/articles/experimenting-with-live-activities-21714.md>)

Original publisher: [Read original article](<https://oleb.net/2022/live-activity/>)

Author: Ole Begemann

Published: 2022-08-03T16:50:39Z

Content type: tutorial

Language: en

Sources: [Ole Begemann](<https://devfeed.tech/sources/ole-begemann.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [API](<https://devfeed.tech/topics/api.md>), [real-time](<https://devfeed.tech/topics/real-time.md>), [Bluetooth](<https://devfeed.tech/topics/bluetooth.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apple](<https://devfeed.tech/tags/apple.md>), [bluetooth](<https://devfeed.tech/tags/bluetooth.md>), [ios](<https://devfeed.tech/tags/ios.md>), [sdk](<https://devfeed.tech/tags/sdk.md>)

## AI overview

An experiment with iOS Live Activities in iOS 16 beta 4, including a bike-computer speedometer use case and observations about starting, updating, and dismissing activities.

## Source excerpt

iOS 16 beta 4 is the first SDK release that supports Live Activities. A Live Activity is a widget-like view an app can place on your lock screen and update in real time. Examples where this can be useful include live sports scores or train departure times. These are my notes on playing with the API and implementing my first Live Activity. A bike computer on your lock screen My Live Activity is a display for a bike computer that I've been developing with a group a friends. Here's a video of it in action: Download video And here with simulated data: Download video I haven't talked much about our bike computer project publicly yet; that will hopefully change someday. In short, a group of friends and I designed a little box that connects to your bike's hub dynamo, measures speed and distance, and sends the data via Bluetooth to an iOS app. The app records all your rides and can also act as a live speedometer when mounted on your bike's handlebar. It's this last feature that I wanted to replicate in the Live Activity. Follow Apple's guide Adding a Live Activity to the app wasn't hard. I found Apple's guide Displaying live data on the Lock Screen with Live Activities easy to follow and quite comprehensive. No explicit user approval iOS doesn't ask the user for approval when an app wants to show a Live Activity. I found this odd since it seems to invite developers to abuse the feature, but maybe it's OK because of the foreground requirement (see below). Plus, users can disallow Live Activities on a per-app basis in Settings. Users can dismiss an active Live Activity from the lock screen by swiping (like a notification). Most apps will probably need to ask the user for notification permissions to update their Live Activities. The app must be in the foreground to start an activity To start a Live Activity, an app must be open in the foreground. This isn't ideal for the bike computer because the speedometer can't appear magically on the lock screen when the user starts riding