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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 1.9.0

### New Features

- **New Feature: App Icon Badge Count** - Show MRR, user counts, stock prices, and more on your ActivitySmith app icon.
75 changes: 60 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction).
- [Live Activity Action](#live-activity-action)
- [Icons and Badges](#icons-and-badges)
- [Live Activity Colors](#live-activity-colors)
- [Channels](#channels)
- [Widgets](#widgets)
- [App Icon Badge Count](#app-icon-badge-count)
- [Channels](#channels)

## Installation

Expand Down Expand Up @@ -535,20 +536,6 @@ Choose from these colors for the Live Activity accent, including progress bars a

`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`

## Channels

Channels are used to target specific team members or devices. Can be used for both push notifications and live activities.

```ruby
activitysmith.notifications.send(
{
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
channels: ["sales", "customer-success"] # Optional
}
)
```

## Widgets

<p align="center">
Expand All @@ -571,6 +558,64 @@ String metric values work too.
activitysmith.metrics.update("prod.status", "healthy")
```

## App Icon Badge Count

<p align="center">
<img src="https://cdn.activitysmith.com/features/badge-count.png" alt="ActivitySmith app icon with an App Icon Badge Count" width="680" />
</p>

Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view.

Set or update the badge value.

```ruby
activitysmith.badge_count(8333)
```

To clear the badge, set its value to 0.

```ruby
activitysmith.badge_count(0)
```

## Channels

Use `channels` to target specific team members or devices

### Push Notifications

```ruby
activitysmith.notifications.send(
{
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
channels: ["sales", "customer-success"]
}
)
```

### Live Activities

```ruby
activitysmith.live_activities.start(
{
content_state: {
title: "Nightly Database Backup",
subtitle: "verify restore",
type: "progress",
percentage: 62
},
channels: ["sales", "customer-success"]
}
)
```

### App Icon Badge Count

```ruby
activitysmith.badge_count(3, channels: ["sales", "customer-success"])
```

## Error Handling

```ruby
Expand Down
3 changes: 3 additions & 0 deletions generated/activitysmith_openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
require 'activitysmith_openapi/models/activity_metric'
require 'activitysmith_openapi/models/activity_metric_value'
require 'activitysmith_openapi/models/alert_payload'
require 'activitysmith_openapi/models/app_icon_badge_count_update_request'
require 'activitysmith_openapi/models/app_icon_badge_count_update_response'
require 'activitysmith_openapi/models/bad_request_error'
require 'activitysmith_openapi/models/channel_target'
require 'activitysmith_openapi/models/content_state_end'
Expand Down Expand Up @@ -59,6 +61,7 @@
require 'activitysmith_openapi/models/stream_content_state'

# APIs
require 'activitysmith_openapi/api/app_icon_badges_api'
require 'activitysmith_openapi/api/live_activities_api'
require 'activitysmith_openapi/api/metrics_api'
require 'activitysmith_openapi/api/push_notifications_api'
Expand Down
90 changes: 90 additions & 0 deletions generated/activitysmith_openapi/api/app_icon_badges_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
=begin
#ActivitySmith API

#Send push notifications and Live Activities to your own devices via a single API key.

The version of the OpenAPI document: 1.0.0

Generated by: https://openapi-generator.tech
Generator version: 7.7.0

=end

require 'cgi'

module OpenapiClient
class AppIconBadgesApi
attr_accessor :api_client

def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Update App Icon Badge Count
# Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item.
# @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
# @param [Hash] opts the optional parameters
# @return [AppIconBadgeCountUpdateResponse]
def update_app_icon_badge_count(app_icon_badge_count_update_request, opts = {})
data, _status_code, _headers = update_app_icon_badge_count_with_http_info(app_icon_badge_count_update_request, opts)
data
end

# Update App Icon Badge Count
# Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send &#x60;badge: 0&#x60; to clear the count. Badge updates are independent of push notifications and do not create a push notification history item.
# @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(AppIconBadgeCountUpdateResponse, Integer, Hash)>] AppIconBadgeCountUpdateResponse data, response status code and response headers
def update_app_icon_badge_count_with_http_info(app_icon_badge_count_update_request, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: AppIconBadgesApi.update_app_icon_badge_count ...'
end
# verify the required parameter 'app_icon_badge_count_update_request' is set
if @api_client.config.client_side_validation && app_icon_badge_count_update_request.nil?
fail ArgumentError, "Missing the required parameter 'app_icon_badge_count_update_request' when calling AppIconBadgesApi.update_app_icon_badge_count"
end
# resource path
local_var_path = '/badge'

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(app_icon_badge_count_update_request)

# return_type
return_type = opts[:debug_return_type] || 'AppIconBadgeCountUpdateResponse'

# auth_names
auth_names = opts[:debug_auth_names] || ['apiKeyAuth']

new_options = opts.merge(
:operation => :"AppIconBadgesApi.update_app_icon_badge_count",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: AppIconBadgesApi#update_app_icon_badge_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end
Loading