Installation
To install the ActivitySmith Ruby SDK, you can use RubyGems:Ruby
Usage
- Get an API key from ActivitySmith
- Set the API key as an environment variable named
ACTIVITYSMITH_API_KEYor pass it directly toActivitySmith::Client.
Ruby
Send a Push Notification
Useactivitysmith.notifications.send with a push payload. title is required; message and subtitle are optional.
Ruby
Start a Live Activity
Start a Live Activity withactivitysmith.live_activities.start.
Ruby
Update a Live Activity
Update a Live Activity withactivitysmith.live_activities.update using the activity_id.
Ruby
End a Live Activity
End a Live Activity withactivitysmith.live_activities.end. You can optionally set auto_dismiss_minutes in the content_state.
Ruby
Error Handling
Handle API errors withbegin/rescue around SDK calls:
Ruby