Skip to content

feat #609: Add Live Activity support for transit arrival/departure monitor…#1106

Open
prince-0408 wants to merge 1 commit intoOneBusAway:mainfrom
prince-0408:feature/live-activity-transit-monitoring-609
Open

feat #609: Add Live Activity support for transit arrival/departure monitor…#1106
prince-0408 wants to merge 1 commit intoOneBusAway:mainfrom
prince-0408:feature/live-activity-transit-monitoring-609

Conversation

@prince-0408
Copy link
Copy Markdown

Pull Request: Add Live Activity Support for Transit Arrival/Departure Monitoring

Closes #609


Summary

This PR implements full iOS Live Activity support using Apple's ActivityKit framework, allowing users to track real-time transit arrivals and departures from the Lock Screen and Dynamic Island — without opening the app.


Files Changed

File Type Description
OBAKitCore/LiveActivity/TransitArrivalAttributes.swift New ActivityKit ActivityAttributes model — defines static trip data and dynamic ContentState
OBAKit/LiveActivity/LiveActivityManager.swift New Core manager — handles start, update, stop, and map snapshot lifecycle
OBAKit/LiveActivity/LiveActivityDurationPicker.swift New BLTNBoard bulletin with UIPickerView for selecting activity duration
OBAKit/LiveActivity/LiveActivityListItem.swift New OBAListViewItem row shown on the Stop page to start/stop a Live Activity
OBAKit/Stops/StopViewController+LiveActivity.swift New Extension wiring Live Activity into the Stop page (list section, menu, swipe actions, auto-update)
OBAWidget/LiveActivity/TransitLiveActivityWidget.swift New Full SwiftUI widget — Lock Screen banner + all Dynamic Island layouts
OBAKit/Stops/StopViewController.swift Modified Integrates liveActivitySection into the list and triggers updates on arrival refresh
OBAKit/Bookmarks/BookmarksViewController.swift Modified Adds long-press/context menu "Start/Stop Live Activity" on bookmark cells
OBAKit/Orchestration/Application.swift Modified Initialises LiveActivityManager and exposes it app-wide
OBAKit/Stops/Sections/StopArrival/StopArrivalItem.swift Modified Exposes arrival data needed for Live Activity swipe actions
OBAWidget/Main/OBAWidgetBundle.swift Modified Registers TransitLiveActivityWidget in the widget bundle
Apps/KiedyBus/project.yml Modified Adds ActivityKit capability + new source files
Apps/OneBusAway/project.yml Modified Adds ActivityKit capability + new source files
OBAWidget/project.yml Modified Adds LiveActivity/ source group to widget target
Apps/OneBusAway/Assets.xcassets/Logo.imageset/ New App logo assets used in the Live Activity widget badge

iOS Version Requirement

All Live Activity code is guarded with @available(iOS 16.2, *) and #available(iOS 16.2, *) checks. The feature is silently unavailable on older OS versions — no UI is shown and no crashes occur.


Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-03-15.at.22.39.54.mov
Screen.Recording.2026-03-15.at.10.53.47.PM.mov
Screen.Recording.2026-03-15.at.10.58.02.PM.mov
Screen.Recording.2026-03-15.at.10.58.50.PM.mov

…ing (OneBusAway#609)

Implements iOS Live Activity support to allow users to track transit
arrivals/departures in real-time from the Lock Screen and Dynamic Island.

## What's New

### Core Live Activity Infrastructure
- Add TransitArrivalAttributes (OBAKitCore/LiveActivity/) defining the
  ActivityAttributes for Live Activities, including arrival time, route
  info, stop name, and headsign
- Add LiveActivityManager (OBAKit/LiveActivity/) to handle starting,
  updating, and stopping Live Activities via ActivityKit
- Add LiveActivityDurationPicker (OBAKit/LiveActivity/) — a UI picker
  letting users choose how long the Live Activity runs (5 min, 15 min,
  30 min, 1 hr, 2 hr, 4 hr, 8 hr), defaulting to 1 hour; selection is
  persisted so it is pre-selected next time
- Add LiveActivityListItem (OBAKit/LiveActivity/) — a list row item for
  starting/stopping a Live Activity from the Stop page

### Widget Extension
- Add TransitLiveActivityWidget (OBAWidget/LiveActivity/) implementing
  the Lock Screen and Dynamic Island UI for the Live Activity
- Register the new widget in OBAWidgetBundle

### Stop Page Integration
- Add StopViewController+LiveActivity.swift extension wiring up the
  Live Activity list item into the Stop page, displayed below the map
  and above service alerts (as specified in issue OneBusAway#609)
- Update StopViewController.swift to include the Live Activity section
  and refresh it alongside arrival data
- Update StopArrivalItem to expose data needed by the Live Activity

### Bookmarks Integration
- Update BookmarksViewController to surface a 'Start Live Activity'
  option on long-press / swipe actions on bookmark cells, matching the
  UI flow described in issue OneBusAway#609

### Project Configuration
- Update Apps/KiedyBus/project.yml, Apps/OneBusAway/project.yml, and
  OBAWidget/project.yml to include the new LiveActivity source files
  and the ActivityKit capability
- Add OneBusAway logo image assets

### Application Bootstrap
- Update Application.swift to initialise LiveActivityManager and wire
  it into the app lifecycle

Closes OneBusAway#609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for live activities to monitor transit arrival/departure

1 participant