Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.12.0

Adds the new `value` Live Activity type.

## 1.11.0

This version adds support for Metadata and iOS deep links, and expands Tags support when updating or ending Live Activities.
Expand Down
90 changes: 53 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,33 +140,45 @@ activitysmith.notifications.send(

Choose the Live Activity type that matches what you want to show:

![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png)
- ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png) **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature.

**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.
- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion.

![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.

**Metrics**: Track two related values with segmented bars, such as CPU and memory.
- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory.

![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png)
- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.

**Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify.
- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion.

![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png)
- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs.

**Progress**: Show percentage progress for jobs that move continuously toward completion.

![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png)
### Start & Update Live Activity

**Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint.
Use a stable `stream_key` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `stream_key` update it.

![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png)
#### Value

**Timer**: Count down from a duration, or count up from 00:00 while a job runs.
![Value Live Activity stream example](https://cdn.activitysmith.com/features/value-live-activity.png)

### Start & Update Live Activity
```ruby
activitysmith.live_activities.stream(
"revenue-today",
{
content_state: {
title: "Revenue",
type: "value",
value: "$1,240",
color: "green",
icon: { symbol: "dollarsign.circle", color: "green" },
badge: { title: "↑ 18%", color: "purple" }
}
}
)
```

Use a stable `stream_key` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `stream_key` update it.
Send a string or number in `value`. Strings keep their formatting, including currency symbols, units, and decimal places.

#### Stats

Expand All @@ -193,6 +205,25 @@ activitysmith.live_activities.stream(
)
```

#### Alert

![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png)

```ruby
activitysmith.live_activities.stream(
"customer-ops",
{
content_state: ActivitySmith::LiveActivities.content_state(
title: "Reactivation",
message: "Lumen came back after 2 weeks",
type: ActivitySmith::LiveActivities::TYPE_ALERT,
icon: ActivitySmith::LiveActivities.alert_icon("cloud.sun", color: "yellow"),
badge: ActivitySmith::LiveActivities.alert_badge("Customer", color: "magenta")
)
}
)
```

#### Metrics

![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png)
Expand Down Expand Up @@ -251,25 +282,6 @@ activitysmith.live_activities.stream(
)
```

#### Alert

![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png)

```ruby
activitysmith.live_activities.stream(
"customer-ops",
{
content_state: ActivitySmith::LiveActivities.content_state(
title: "Reactivation",
message: "Lumen came back after 2 weeks",
type: ActivitySmith::LiveActivities::TYPE_ALERT,
icon: ActivitySmith::LiveActivities.alert_icon("cloud.sun", color: "yellow"),
badge: ActivitySmith::LiveActivities.alert_badge("Customer", color: "magenta")
)
}
)
```

#### Timer

![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png)
Expand Down Expand Up @@ -321,7 +333,7 @@ Add more context to Live Activities with icons and badges.

#### Icon

Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
Supported Live Activity types: `value`, `stats`, `alert`, `metrics`, `segmented_progress`, `progress`, and `timer`.

![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png)

Expand Down Expand Up @@ -351,7 +363,7 @@ The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one

#### Badge

Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities.
Badges are supported by `value`, `alert`, `segmented_progress`, and `progress` Live Activities.

![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png)

Expand Down Expand Up @@ -471,7 +483,7 @@ activitysmith.live_activities.stream(

Use `secondary_action` when you want a second button beside the primary `action`.

The secondary action button is supported for `alert`, `progress`, and `segmented_progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes.
The secondary action button is supported for `value`, `alert`, `segmented_progress`, and `progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes.

```ruby
activitysmith.live_activities.stream(
Expand Down Expand Up @@ -653,3 +665,7 @@ end
### [RubyGems Package](https://rubygems.org/gems/activitysmith)

Install the ActivitySmith Ruby SDK from RubyGems

### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-ruby)

View the Ruby SDK source on GitHub
1 change: 1 addition & 0 deletions generated/activitysmith_openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
require 'activitysmith_openapi/models/live_activity_stream_request'
require 'activitysmith_openapi/models/live_activity_update_request'
require 'activitysmith_openapi/models/live_activity_update_response'
require 'activitysmith_openapi/models/live_activity_value'
require 'activitysmith_openapi/models/live_activity_webhook_method'
require 'activitysmith_openapi/models/metadata_value'
require 'activitysmith_openapi/models/metric_error'
Expand Down
Loading
Loading