Templates
A template decides what a live activity looks like on the device.
Generic Template
Section titled “Generic Template”ID: generic
The generic template is currently the only template available and it is designed to fit a wide range of use cases oriented around an activity with progress.
API schema
Section titled “API schema”| Field | Type | Description | Required? |
|---|---|---|---|
template | "generic" | Identifies this template. | Yes |
progress | float | Progress of the activity in range [0.0-1.0]. | Yes |
state | string | Describes the state of the activity. | No |
icon | string | An SF Symbols icon. | No |
remaining_time | int | Remaining time in seconds. | No |
To get a better understanding of how this schema correlates to a displayed live activity, see the picture below:
Example populated API schema
Section titled “Example populated API schema”{ "template": "generic", "progress": 0.35, "state": "In progress", "icon": "washer", "remaining_time": 2120}Preview
Section titled “Preview”