Skip to content

Commit d9b3d1c

Browse files
committed
Reorganize README sections
1 parent e667c00 commit d9b3d1c

File tree

1 file changed

+67
-67
lines changed

1 file changed

+67
-67
lines changed

README.md

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ activitysmith = ActivitySmith(
3131
)
3232
```
3333

34-
## Usage
34+
## Push Notifications
3535

3636
### Send a Push Notification
3737

@@ -48,6 +48,72 @@ activitysmith.notifications.send(
4848
)
4949
```
5050

51+
### Rich Push Notifications with Media
52+
53+
<p align="center">
54+
<img src="https://cdn.activitysmith.com/features/rich-push-notification-with-image.png" alt="Rich push notification with image" width="680" />
55+
</p>
56+
57+
```python
58+
activitysmith.notifications.send(
59+
{
60+
"title": "Homepage ready",
61+
"message": "Your agent finished the redesign.",
62+
"media": "https://cdn.example.com/output/homepage-v2.png",
63+
"redirection": "https://github.com/acme/web/pull/482",
64+
}
65+
)
66+
```
67+
68+
Send images, videos, or audio with your push notifications, press and hold to preview media directly from the notification, then tap through to open the linked content.
69+
70+
<p align="center">
71+
<img src="https://cdn.activitysmith.com/features/rich-push-notification-with-audio.png" alt="Rich push notification with audio" width="680" />
72+
</p>
73+
74+
What will work:
75+
76+
- direct image URL: `.jpg`, `.png`, `.gif`, etc.
77+
- direct audio file URL: `.mp3`, `.m4a`, etc.
78+
- direct video file URL: `.mp4`, `.mov`, etc.
79+
- URL that responds with a proper media `Content-Type`, even if the path has no extension
80+
81+
### Actionable Push Notifications
82+
83+
<p align="center">
84+
<img src="https://cdn.activitysmith.com/features/actionable-push-notifications-2.png" alt="Actionable push notification example" width="680" />
85+
</p>
86+
87+
Actionable push notifications can open a URL on tap or trigger actions when someone long-presses the notification.
88+
Webhooks are executed by the ActivitySmith backend.
89+
90+
```python
91+
activitysmith.notifications.send(
92+
{
93+
"title": "New subscription 💸",
94+
"message": "Customer upgraded to Pro plan",
95+
"redirection": "https://crm.example.com/customers/cus_9f3a1d", # Optional
96+
"actions": [ # Optional (max 4)
97+
{
98+
"title": "Open CRM Profile",
99+
"type": "open_url",
100+
"url": "https://crm.example.com/customers/cus_9f3a1d",
101+
},
102+
{
103+
"title": "Start Onboarding Workflow",
104+
"type": "webhook",
105+
"url": "https://hooks.example.com/activitysmith/onboarding/start",
106+
"method": "POST",
107+
"body": {
108+
"customer_id": "cus_9f3a1d",
109+
"plan": "pro",
110+
},
111+
},
112+
],
113+
}
114+
)
115+
```
116+
51117
## Live Activities
52118

53119
Live Activities come in two UI types, but the lifecycle stays the same:
@@ -218,72 +284,6 @@ activitysmith.notifications.send(
218284
)
219285
```
220286

221-
## Rich Push Notifications with Media
222-
223-
<p align="center">
224-
<img src="https://cdn.activitysmith.com/features/rich-push-notification-with-image.png" alt="Rich push notification with image" width="680" />
225-
</p>
226-
227-
```python
228-
activitysmith.notifications.send(
229-
{
230-
"title": "Homepage ready",
231-
"message": "Your agent finished the redesign.",
232-
"media": "https://cdn.example.com/output/homepage-v2.png",
233-
"redirection": "https://github.com/acme/web/pull/482",
234-
}
235-
)
236-
```
237-
238-
Send images, videos, or audio with your push notifications, press and hold to preview media directly from the notification, then tap through to open the linked content.
239-
240-
<p align="center">
241-
<img src="https://cdn.activitysmith.com/features/rich-push-notification-with-audio.png" alt="Rich push notification with audio" width="680" />
242-
</p>
243-
244-
What will work:
245-
246-
- direct image URL: `.jpg`, `.png`, `.gif`, etc.
247-
- direct audio file URL: `.mp3`, `.m4a`, etc.
248-
- direct video file URL: `.mp4`, `.mov`, etc.
249-
- URL that responds with a proper media `Content-Type`, even if the path has no extension
250-
251-
## Actionable Push Notifications
252-
253-
<p align="center">
254-
<img src="https://cdn.activitysmith.com/features/actionable-push-notifications-2.png" alt="Actionable push notification example" width="680" />
255-
</p>
256-
257-
Actionable push notifications can open a URL on tap or trigger actions when someone long-presses the notification.
258-
Webhooks are executed by the ActivitySmith backend.
259-
260-
```python
261-
activitysmith.notifications.send(
262-
{
263-
"title": "New subscription 💸",
264-
"message": "Customer upgraded to Pro plan",
265-
"redirection": "https://crm.example.com/customers/cus_9f3a1d", # Optional
266-
"actions": [ # Optional (max 4)
267-
{
268-
"title": "Open CRM Profile",
269-
"type": "open_url",
270-
"url": "https://crm.example.com/customers/cus_9f3a1d",
271-
},
272-
{
273-
"title": "Start Onboarding Workflow",
274-
"type": "webhook",
275-
"url": "https://hooks.example.com/activitysmith/onboarding/start",
276-
"method": "POST",
277-
"body": {
278-
"customer_id": "cus_9f3a1d",
279-
"plan": "pro",
280-
},
281-
},
282-
],
283-
}
284-
)
285-
```
286-
287287
## Error Handling
288288

289289
```python

0 commit comments

Comments
 (0)