Saltar al contenido

Plantilla de Timer

Un temporizador con ciclo de vida gestionado por el servidor: envía un único push de inicio y el servidor dispara por sí solo las actualizaciones de advertencia y finalización.

Demostración de una actividad en directo

Fields

FieldTypeDescription
templatestringRequired. "timer", or "countdown", the template's original name. Both are accepted; responses and pushes report "countdown"
progressfloatInitial progress (usually 0.0); the completion push sets 1.0
durationstringRequired (or end_date). Server-side convenience — converted to end_date before reaching the device. Accepts: "30s", "5m", "1h30m", or plain seconds ("1500")
end_dateintegerRequired (or duration). Unix timestamp when the countdown expires
start_dateintegerUnix timestamp when the countdown began. Must be less than end_date. Used to compute progress on-device.
warning_thresholdintegerSeconds before end_date to send a warning push (accent turns orange)
completion_messagestringText shown when countdown expires (default: "Completed")
statestringStatus text (e.g. "Baking", "Printing")
iconstringSF Symbol name or MDI icon with mdi: prefix (e.g. "mdi:timer-outline")
subtitlestringSecondary text
accent_colorstringNamed color or hex
background_colorstringBackground color override
text_colorstringText color override
alarmbooleanOpt-in: schedule an iOS AlarmKit alarm at end_date that rings through silent mode and Focus, with built-in Dismiss and Snooze. iOS 26+ only. Persists across partial updates until cleared with alarm: null or a transition to ended — see Alarms.
snooze_secondsintegerHow long the alarm's Snooze button defers the alarm, in seconds (60–3600). Defaults to 300 (5 minutes).
Llega en la versión 1.14.0 de la app
Llega en la versión 1.19.0 de la app

Accepts url_action, secondary_url_action, and tap_action — tap_action is useful for deep-linking back into the timer's source app while it runs. See Tap actions.

Example Payload

Iniciar una cuenta atrás
{
  "state": "ongoing",
  "content": {
    "template": "timer",
    "progress": 0.0,
    "state": "Baking",
    "icon": "flame",
    "subtitle": "25 min timer",
    "duration": "25m",
    "warning_threshold": 60,
    "completion_message": "Done baking!",
    "accent_color": "orange",
    "alarm": true
  }
}

Auto-Managed Lifecycle

After the start push the server manages the remaining lifecycle, in this order; the timer display itself is computed on-device from start_date and end_date, so it counts down in real time without additional pushes.

PhaseTriggerWhat the server sends
StartYour pushNothing -- your update sets ended -> ongoing with the countdown content
Warningwarning_threshold seconds remainAn update with accent_color: "orange", automatically
Completionend_date reachedAn end push with completion_message and progress: 1.0
Llega en la versión 1.19.0 de la app

Esta sección describe una función de una actualización de la app que está pendiente de revisión en App Store. Se desbloquea aquí automáticamente en cuanto la actualización esté disponible.