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.
71 changes: 58 additions & 13 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 @@ -468,18 +469,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.

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

## Widgets

<p align="center">
Expand All @@ -504,6 +493,62 @@ String metric values work too.
await 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.

```ts
await activitysmith.badgeCount(8333);
```

To clear the badge, set its value to 0.

```ts
await activitysmith.badgeCount(0);
```

## Channels

Use `channels` to target specific team members or devices

### Push Notifications

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

### Live Activities

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

### App Icon Badge Count

```ts
await activitysmith.badgeCount(3, {
channels: ["sales", "customer-success"],
});
```

## Error Handling

```ts
Expand Down
81 changes: 81 additions & 0 deletions generated/apis/AppIconBadgesApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import * as runtime from '../runtime';
import type {
AppIconBadgeCountUpdateRequest,
AppIconBadgeCountUpdateResponse,
BadRequestError,
ForbiddenError,
NoRecipientsError,
RateLimitError,
} from '../models/index';

export interface UpdateAppIconBadgeCountRequest {
appIconBadgeCountUpdateRequest: AppIconBadgeCountUpdateRequest;
}

/**
*
*/
export class AppIconBadgesApi extends runtime.BaseAPI {

/**
* 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.
* Update App Icon Badge Count
*/
async updateAppIconBadgeCountRaw(requestParameters: UpdateAppIconBadgeCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AppIconBadgeCountUpdateResponse>> {
if (requestParameters['appIconBadgeCountUpdateRequest'] == null) {
throw new runtime.RequiredError(
'appIconBadgeCountUpdateRequest',
'Required parameter "appIconBadgeCountUpdateRequest" was null or undefined when calling updateAppIconBadgeCount().'
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
const token = this.configuration.accessToken;
const tokenString = await token("apiKeyAuth", []);

if (tokenString) {
headerParameters["Authorization"] = `Bearer ${tokenString}`;
}
}
const response = await this.request({
path: `/badge`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['appIconBadgeCountUpdateRequest'],
}, initOverrides);

return new runtime.JSONApiResponse(response);
}

/**
* 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.
* Update App Icon Badge Count
*/
async updateAppIconBadgeCount(requestParameters: UpdateAppIconBadgeCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AppIconBadgeCountUpdateResponse> {
const response = await this.updateAppIconBadgeCountRaw(requestParameters, initOverrides);
return await response.value();
}

}
1 change: 1 addition & 0 deletions generated/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* tslint:disable */
/* eslint-disable */
export * from './AppIconBadgesApi';
export * from './LiveActivitiesApi';
export * from './MetricsApi';
export * from './PushNotificationsApi';
Loading