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

### New Features

- **New Feature: Tags** — Organize and filter your Push Notification and Live Activity history using one or more tags.

## 1.9.0

### New Features
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction).
- [Widgets](#widgets)
- [App Icon Badge Count](#app-icon-badge-count)
- [Channels](#channels)
- [Tags](#tags)

## Installation

Expand Down Expand Up @@ -616,6 +617,20 @@ activitysmith.live_activities.start(
activitysmith.badge_count(3, channels: ["sales", "customer-success"])
```

## Tags

Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them.

```ruby
activitysmith.notifications.send(
{
title: "New subscription 💸",
message: "Customer upgraded to Pro plan",
tags: ["user:382", "billing"]
}
)
```

## Error Handling

```ruby
Expand Down
8 changes: 4 additions & 4 deletions generated/activitysmith_openapi/api/app_icon_badges_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class AppIconBadgesApi
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.
# Set App Icon Badge Count
# Shows a number on the ActivitySmith app icon.
# @param app_icon_badge_count_update_request [AppIconBadgeCountUpdateRequest]
# @param [Hash] opts the optional parameters
# @return [AppIconBadgeCountUpdateResponse]
Expand All @@ -29,8 +29,8 @@ def update_app_icon_badge_count(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 `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item.
# Set App Icon Badge Count
# Shows a number on the ActivitySmith app icon.
# @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
Expand Down
20 changes: 10 additions & 10 deletions generated/activitysmith_openapi/api/live_activities_api.rb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions generated/activitysmith_openapi/api/push_notifications_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Send a push notification
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`.
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [PushNotificationResponse]
Expand All @@ -30,7 +30,7 @@ def send_push_notification(push_notification_request, opts = {})
end

# Send a push notification
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. &#x60;media&#x60; cannot be combined with &#x60;actions&#x60;.
# Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. &#x60;media&#x60; cannot be combined with &#x60;actions&#x60;. Optional tags to organize and filter notification history.
# @param push_notification_request [PushNotificationRequest]
# @param [Hash] opts the optional parameters
# @return [Array<(PushNotificationResponse, Integer, Hash)>] PushNotificationResponse data, response status code and response headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
require 'time'

module OpenapiClient
# App Icon Badge Count update. Send badge 0 to clear the count.
class AppIconBadgeCountUpdateRequest
# The count to show on the ActivitySmith app icon. Send 0 to clear it.
attr_accessor :badge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LiveActivityAction

attr_accessor :type

# Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
# Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
attr_accessor :url

# Webhook HTTP method. Used only when type=webhook.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LiveActivityEndRequest

attr_accessor :action

# Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
# Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
attr_accessor :secondary_action

# Attribute mapping from ruby-style variable name to JSON key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@ class LiveActivityStartRequest

attr_accessor :action

# Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
# Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
attr_accessor :secondary_action

attr_accessor :alert

attr_accessor :target

# Optional tags to organize and filter notification history.
attr_accessor :tags

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'content_state' => :'content_state',
:'action' => :'action',
:'secondary_action' => :'secondary_action',
:'alert' => :'alert',
:'target' => :'target'
:'target' => :'target',
:'tags' => :'tags'
}
end

Expand All @@ -50,7 +54,8 @@ def self.openapi_types
:'action' => :'LiveActivityAction',
:'secondary_action' => :'LiveActivityAction',
:'alert' => :'AlertPayload',
:'target' => :'ChannelTarget'
:'target' => :'ChannelTarget',
:'tags' => :'Array<String>'
}
end

Expand Down Expand Up @@ -96,6 +101,12 @@ def initialize(attributes = {})
if attributes.key?(:'target')
self.target = attributes[:'target']
end

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -127,7 +138,8 @@ def ==(o)
action == o.action &&
secondary_action == o.secondary_action &&
alert == o.alert &&
target == o.target
target == o.target &&
tags == o.tags
end

# @see the `==` method
Expand All @@ -139,7 +151,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[content_state, action, secondary_action, alert, target].hash
[content_state, action, secondary_action, alert, target, tags].hash
end

# Builds the object from hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class LiveActivityStartResponse

attr_accessor :effective_channel_slugs

# Optional tags to organize and filter notification history.
attr_accessor :tags

attr_accessor :timestamp

# Attribute mapping from ruby-style variable name to JSON key.
Expand All @@ -36,6 +39,7 @@ def self.attribute_map
:'users_notified' => :'users_notified',
:'activity_id' => :'activity_id',
:'effective_channel_slugs' => :'effective_channel_slugs',
:'tags' => :'tags',
:'timestamp' => :'timestamp'
}
end
Expand All @@ -53,6 +57,7 @@ def self.openapi_types
:'users_notified' => :'Integer',
:'activity_id' => :'String',
:'effective_channel_slugs' => :'Array<String>',
:'tags' => :'Array<String>',
:'timestamp' => :'Time'
}
end
Expand Down Expand Up @@ -104,6 +109,12 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end

if attributes.key?(:'timestamp')
self.timestamp = attributes[:'timestamp']
else
Expand Down Expand Up @@ -151,6 +162,7 @@ def ==(o)
users_notified == o.users_notified &&
activity_id == o.activity_id &&
effective_channel_slugs == o.effective_channel_slugs &&
tags == o.tags &&
timestamp == o.timestamp
end

Expand All @@ -163,7 +175,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[success, devices_notified, users_notified, activity_id, effective_channel_slugs, timestamp].hash
[success, devices_notified, users_notified, activity_id, effective_channel_slugs, tags, timestamp].hash
end

# Builds the object from hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LiveActivityStreamDeleteRequest

attr_accessor :action

# Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
# Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
attr_accessor :secondary_action

attr_accessor :alert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class LiveActivityStreamPutResponse

attr_accessor :effective_channel_slugs

# Optional tags to organize and filter notification history.
attr_accessor :tags

attr_accessor :timestamp

class EnumAttributeValidator
Expand Down Expand Up @@ -70,6 +73,7 @@ def self.attribute_map
:'devices_queued' => :'devices_queued',
:'users_notified' => :'users_notified',
:'effective_channel_slugs' => :'effective_channel_slugs',
:'tags' => :'tags',
:'timestamp' => :'timestamp'
}
end
Expand All @@ -91,6 +95,7 @@ def self.openapi_types
:'devices_queued' => :'Integer',
:'users_notified' => :'Integer',
:'effective_channel_slugs' => :'Array<String>',
:'tags' => :'Array<String>',
:'timestamp' => :'Time'
}
end
Expand Down Expand Up @@ -161,6 +166,12 @@ def initialize(attributes = {})
end
end

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end

if attributes.key?(:'timestamp')
self.timestamp = attributes[:'timestamp']
else
Expand Down Expand Up @@ -229,6 +240,7 @@ def ==(o)
devices_queued == o.devices_queued &&
users_notified == o.users_notified &&
effective_channel_slugs == o.effective_channel_slugs &&
tags == o.tags &&
timestamp == o.timestamp
end

Expand All @@ -241,7 +253,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[success, operation, stream_key, activity_id, previous_activity_id, devices_notified, devices_queued, users_notified, effective_channel_slugs, timestamp].hash
[success, operation, stream_key, activity_id, previous_activity_id, devices_notified, devices_queued, users_notified, effective_channel_slugs, tags, timestamp].hash
end

# Builds the object from hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LiveActivityStreamRequest

attr_accessor :action

# Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
# Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
attr_accessor :secondary_action

attr_accessor :alert
Expand All @@ -30,6 +30,9 @@ class LiveActivityStreamRequest

attr_accessor :target

# Optional tags to organize and filter notification history.
attr_accessor :tags

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
Expand All @@ -38,7 +41,8 @@ def self.attribute_map
:'secondary_action' => :'secondary_action',
:'alert' => :'alert',
:'channels' => :'channels',
:'target' => :'target'
:'target' => :'target',
:'tags' => :'tags'
}
end

Expand All @@ -55,7 +59,8 @@ def self.openapi_types
:'secondary_action' => :'LiveActivityAction',
:'alert' => :'AlertPayload',
:'channels' => :'Array<String>',
:'target' => :'ChannelTarget'
:'target' => :'ChannelTarget',
:'tags' => :'Array<String>'
}
end

Expand Down Expand Up @@ -107,6 +112,12 @@ def initialize(attributes = {})
if attributes.key?(:'target')
self.target = attributes[:'target']
end

if attributes.key?(:'tags')
if (value = attributes[:'tags']).is_a?(Array)
self.tags = value
end
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -158,7 +169,8 @@ def ==(o)
secondary_action == o.secondary_action &&
alert == o.alert &&
channels == o.channels &&
target == o.target
target == o.target &&
tags == o.tags
end

# @see the `==` method
Expand All @@ -170,7 +182,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[content_state, action, secondary_action, alert, channels, target].hash
[content_state, action, secondary_action, alert, channels, target, tags].hash
end

# Builds the object from hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LiveActivityUpdateRequest

attr_accessor :action

# Optional secondary action button. Supported only for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
# Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
attr_accessor :secondary_action

# Attribute mapping from ruby-style variable name to JSON key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PushNotificationAction

attr_accessor :type

# Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
# Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
attr_accessor :url

# Webhook HTTP method. Used only when type=webhook.
Expand Down
Loading