카운트다운 위젯
특정 날짜까지의 카운트다운으로, 푸시 사이에도 기기에서 계속 흘러갑니다. 시작 날짜를 추가하면 진행 막대가 알아서 채워집니다.
이 섹션은 App Store 심사를 기다리고 있는 앱 업데이트의 기능을 설명합니다. 업데이트가 출시되면 여기에서 자동으로 잠금 해제됩니다.
The countdown template renders the time remaining until a date. WidgetKit redraws the
number itself, so one push sets the target and the widget stays correct for as long as it is
pinned — you only send another update when the target moves.
Fields
| Field | Type | Notes |
|---|---|---|
template | string | Required. Must be "countdown" |
end_date | string | Required. RFC 3339 timestamp of the target. Must be after 2000-01-01 and no more than 366 days in the future. A date already in the past counts up instead of down |
start_date | string | RFC 3339 timestamp the countdown started from. Must be strictly before end_date. Adds a progress bar that advances on device |
expired_text | string | Shown in place of the countdown once end_date passes. Max 64 characters. Absent means the widget keeps counting, showing time elapsed since the target |
label, subtitle, icon, accent_color, background_color, text_color | string | Shared content fields — see the API reference |
Example: certificate renewal
{
"content": {
"template": "countdown",
"end_date": "2027-05-10T16:13:00Z",
"start_date": "2027-05-10T13:00:00Z",
"expired_text": "Renewing",
"label": "Cert renewal",
"subtitle": "api.pushward.app",
"icon": "lock.shield.fill",
"accent_color": "indigo"
}
}Behavior
With only end_date the widget is a bare countdown. Add start_date and it
also draws a bar that fills from the start to the target, advancing between pushes without any
further requests — the widget knows both ends of the window, so it can interpolate. That makes the
template cheap to drive: a maintenance window, a lease expiry, or a release date costs one PATCH
when it is scheduled and one when it changes.
After the target passes, expired_text takes over if you set it ("Renewing", "Out now", "Overdue"). If you did not, the widget flips to counting the
time elapsed since end_date, which is the right default for a deadline you want to
keep staring at.
Dates are bounded on both sides: anything before 2000-01-01 is rejected outright (it catches milliseconds accidentally sent as seconds, which land in 1970), and anything more than 366 days ahead is rejected too. The bounds are re-checked on every PATCH against the merged content, so a widget whose end_date has aged into the past stays patchable.
Pick a target and watch it tick on the playground before wiring it to a real schedule.