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
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ See the [API reference](https://activitysmith.com/docs/api-reference/introductio
- [Widgets](#widgets)
- [App Icon Badge Count](#app-icon-badge-count)
- [Channels](#channels)
- [Tags](#tags)

## Installation

Expand Down Expand Up @@ -590,6 +591,18 @@ 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.

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

## Error Handling

```python
Expand Down
12 changes: 11 additions & 1 deletion activitysmith/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from activitysmith_openapi.api.push_notifications_api import PushNotificationsApi
from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi

SDK_VERSION = "1.9.0"
SDK_VERSION = "1.10.0"
SDK_HEADER_NAME = "X-ActivitySmith-SDK"
SDK_HEADER_VALUE = f"python-v{SDK_VERSION}"

Expand Down Expand Up @@ -210,6 +210,7 @@ def _build_push_request(
actions: Any | None = None,
target: Any | None = None,
channels: Any | None = None,
tags: Any | None = None,
) -> Any:
request_fields = _compact_dict(
{
Expand All @@ -221,6 +222,7 @@ def _build_push_request(
"actions": actions,
"target": target,
"channels": channels,
"tags": tags,
}
)

Expand Down Expand Up @@ -281,6 +283,7 @@ def _build_live_activity_request(
alert: Any | None = None,
target: Any | None = None,
channels: Any | None = None,
tags: Any | None = None,
) -> Any:
content_state_fields = _compact_dict(
{
Expand Down Expand Up @@ -313,6 +316,7 @@ def _build_live_activity_request(
"alert": alert,
"target": target,
"channels": channels,
"tags": tags,
}
)

Expand Down Expand Up @@ -370,6 +374,7 @@ def send(
actions: Any | None = None,
target: Any | None = None,
channels: Any | None = None,
tags: Any | None = None,
):
request = _build_push_request(
request,
Expand All @@ -381,6 +386,7 @@ def send(
actions=actions,
target=target,
channels=channels,
tags=tags,
)
normalized = _validate_push_request(_normalize_channels_target(request))
return self._api.send_push_notification(
Expand Down Expand Up @@ -455,6 +461,7 @@ def start(
alert: Any | None = None,
target: Any | None = None,
channels: Any | None = None,
tags: Any | None = None,
):
request = _build_live_activity_request(
request,
Expand All @@ -480,6 +487,7 @@ def start(
alert=alert,
target=target,
channels=channels,
tags=tags,
)
return self._api.start_live_activity(
live_activity_start_request=_normalize_channels_target(request)
Expand Down Expand Up @@ -614,6 +622,7 @@ def stream(
alert: Any | None = None,
target: Any | None = None,
channels: Any | None = None,
tags: Any | None = None,
):
request = _build_live_activity_request(
request,
Expand All @@ -639,6 +648,7 @@ def stream(
alert=alert,
target=target,
channels=channels,
tags=tags,
)
return self._api.reconcile_live_activity_stream(
stream_key=stream_key,
Expand Down
2 changes: 1 addition & 1 deletion activitysmith_openapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
""" # noqa: E501


__version__ = "1.8.0"
__version__ = "1.10.0"

# import apis into sdk package
from activitysmith_openapi.api.app_icon_badges_api import AppIconBadgesApi
Expand Down
12 changes: 6 additions & 6 deletions activitysmith_openapi/api/app_icon_badges_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def update_app_icon_badge_count(
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> AppIconBadgeCountUpdateResponse:
"""Update App Icon Badge Count
"""Set 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.
Shows a number on the ActivitySmith app icon.

:param app_icon_badge_count_update_request: (required)
:type app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest
Expand Down Expand Up @@ -125,9 +125,9 @@ def update_app_icon_badge_count_with_http_info(
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[AppIconBadgeCountUpdateResponse]:
"""Update App Icon Badge Count
"""Set 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.
Shows a number on the ActivitySmith app icon.

:param app_icon_badge_count_update_request: (required)
:type app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest
Expand Down Expand Up @@ -196,9 +196,9 @@ def update_app_icon_badge_count_without_preload_content(
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Update App Icon Badge Count
"""Set 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.
Shows a number on the ActivitySmith app icon.

:param app_icon_badge_count_update_request: (required)
:type app_icon_badge_count_update_request: AppIconBadgeCountUpdateRequest
Expand Down
Loading