RideKit
Docs/Reference/The trip outside the app

The trip outside the app

While a driver is on the way and during the ride, the rider can follow the trip without opening the app:

  • iOS 16.2+: a Live Activity on the lock screen and in the Dynamic Island.
  • Android: an ongoing notification. On Android 16+ it is a Live Update: a chip in the status bar ("19 min") and a ProgressStyle card on the lock screen and in the shade. Earlier versions show the same content as a standard progress notification.

Both show the driver's name and car and count down to the pickup ETA by themselves, with no updates needed for the countdown. They follow the ride through these states:

Ride status Lock screen
accepted "Imran is on the way", car, plate, ETA countdown, progress as the car closes in Starts
arrived "Your driver has arrived" — meet them at the pickup Updates
in_progress "On your way" — heading to your drop-off Updates
completed "You've arrived", thanks for riding with brand Ends, stays up 2 minutes
cancelled "Ride cancelled" Ends, stays up 30 seconds
back to requested (the driver cancelled before pickup) — Ends at once. The next driver's acceptance starts a new one with their car.

The text is in the rider's app language, and the Android card and chip use the operator's brand colour and notification icon (notificationIcon in brand.config.json, see BRANDING-ASSETS.md).

While the app is asleep: Admin → Providers → Apple Push

The rider app keeps both current while it runs. Android keeps a backgrounded app running long enough for that in practice. iOS suspends it, so when the phone is locked only Apple's push service can reach the Live Activity. Each Live Activity reports its own push token to the server (POST /rides/:id/live-activity), and on every ride status change the server pushes the new state to it.

To turn this on, create an APNs key and enter it under Admin → Providers → Apple Push — trip Live Activities (iOS):

  1. In your Apple Developer account, open Certificates, Identifiers & Profiles → Keys → +, tick Apple Push Notifications service (APNs), and download the .p8 file. Apple lets you download it only once.

  2. Fill in the fields:

    Field What to enter
    Key ID The 10-character ID shown next to the key
    Team ID Your 10-character team ID (top right of the developer site)
    APNs key (.p8 contents) The whole file as text, including its BEGIN and END lines
    Rider app bundle ID Your rider app's iosBundleId from brand.config.json
    Environment production for App Store and TestFlight builds, sandbox for builds run from Xcode

The same values can come from the environment instead (APNS_KEY_ID, APNS_TEAM_ID, APNS_PRIVATE_KEY, APNS_RIDER_BUNDLE_ID, APNS_ENVIRONMENT). What is entered in Admin wins.

Like every provider credential, the key is stored encrypted and shown only masked. Without a key nothing breaks: the Live Activity still counts the ETA down on its own and catches up the moment the rider opens the app.

The server signs its requests with the key (ES256 tokens, renewed every 50 minutes) and sends them over HTTP/2 to api.push.apple.com, or to api.sandbox.push.apple.com in the sandbox environment. A token Apple reports as gone is retired and never pushed again. Tokens are kept in ride_live_activities (migration 080).

Building

  • iOS: the widget is the targets/ride-activity extension in the rider app, added at prebuild by @bacons/apple-targets, with NSSupportsLiveActivities set in Info.plist. Its accent colour is brandColor. The activity's attributes type (RideActivityAttributes.swift) exists twice, once in the widget and once in the app's ridekit-live module, and a test keeps the two identical: if they ever differ, the activity silently never shows.
  • Android: ridekit-live posts on the ridekit_trip_live channel and asks for promotion with POST_PROMOTED_NOTIFICATIONS. The rider must allow notifications (Android 13+).

Testing it

  • Simulator / emulator: both work for everything except APNs. A simulator build has no push entitlement, so it never reports a token. To test pushes while locked you need a real iPhone with a development build and Environment = sandbox.
  • Android: adb shell dumpsys notification --noredact shows the card's state (PROMOTED_ONGOING, the countdown and the progress).
source: docs/live-activities.md (ships identically in the product zip)