From 52f79aea52c9342d9f7cf9145ae65cae57c94e83 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sat, 7 Feb 2026 10:47:03 +0100 Subject: [PATCH] docs: improve README examples and usage flow --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 95a3bdf..66a6a76 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ response = activitysmith.notifications.send( message: "CI pipeline failed on main branch" } ) + +puts response.success +puts response.devices_notified ``` ### Start a Live Activity @@ -39,10 +42,12 @@ response = activitysmith.notifications.send( start = activitysmith.live_activities.start( { content_state: { - title: "Deploy", + title: "ActivitySmith API Deployment", + subtitle: "start", number_of_steps: 4, current_step: 1, - type: "segmented_progress" + type: "segmented_progress", + color: "yellow" } } ) @@ -57,11 +62,14 @@ update = activitysmith.live_activities.update( { activity_id: activity_id, content_state: { - title: "Deploy", + title: "ActivitySmith API Deployment", + subtitle: "npm i & pm2", current_step: 3 } } ) + +puts update.devices_notified ``` ### End a Live Activity @@ -71,12 +79,15 @@ finish = activitysmith.live_activities.end( { activity_id: activity_id, content_state: { - title: "Deploy Complete", + title: "ActivitySmith API Deployment", + subtitle: "done", current_step: 4, auto_dismiss_minutes: 3 } } ) + +puts finish.success ``` ## Error Handling @@ -86,8 +97,8 @@ begin activitysmith.notifications.send( { title: "Build Failed" } ) -rescue OpenapiClient::ApiError => e - puts "Request failed: #{e.code} #{e.message}" +rescue OpenapiClient::ApiError => err + puts "Request failed: #{err.code} #{err.message}" end ```