Events

Register a Team HQ Live Activity

Changed on

Authenticated. Registers routing for an iOS Lock Screen / Dynamic Island match card, keyed per user + fixture + club. Requires UserSettings.liveScoreUpdates consent (403 FORBIDDEN otherwise). activityId is minted server-side (hq:{gameId}:{teamId}:{userId}) and returned; the client calls OneSignal.LiveActivities.enter(activityId, pushToken). pushToken is an optional hex ActivityKit token stored for that client call. A later POST that omits it does not clear the stored token. The server never sends the token to Apple or OneSignal — Live Activity updates and ends go through OneSignal's live_activities API. Android (#697) writes a platform:"android" opt-in row on the same user+fixture+club key (no pushToken) and returns { registered: true, platform: "android", activityId: <minted>, expiresAt: null } after the same game/team/consent checks — the row opts the fan into Android Live Update pushes for that fixture+club (they ride ordinary push subscriptions, so no ActivityKit token is stored). A register on an already-live fixture also sends that fan a catch-up push with the current score.

post/api/events/{gameId}/live-activity

Request

  • Base URL
    https://app.d-sports.org
  • Auth
    HTTP bearer

Path parameters

gameIdstring required

Request body

teamIdstring required

Must be the fixture's homeTeamId or awayTeamId. Decides the card theme and the minted activityId.

platform'ios' | 'android'

ios writes a LiveActivityRegistration row and returns activityId/expiresAt. android writes a platform:"android" opt-in row (no pushToken) and returns platform android + minted activityId + null expiresAt — opting the fan into Android Live Update pushes for that fixture+club. Any other value is 400 VALIDATION_ERROR.

pushTokenstring nullable

Optional hex ActivityKit token stored for the client call OneSignal.LiveActivities.enter(activityId, pushToken). Omitted on a later POST leaves the stored token in place. The server never sends it to Apple or OneSignal.

Response

Registered (iOS: expiresAt set; Android: platform android + minted activityId, null expiresAt)

successtrue required

Example response

{
  "data": {
    "activityId": "hq:hockey-9001:bos:user_1"
  }
}

Changes

    • breaking

      request property was restricted to a list of enum values

    • breaking

      the // response's property type changed from null to string for status

    • info

      added the new android enum value to the request property

    1 more change in this revision