Installation
To install the ActivitySmith PHP SDK, you can use Composer:PHP
Usage
- Create an API key
- Set the API key as an environment variable named
ACTIVITYSMITH_API_KEYor pass it directly toActivitySmith.
PHP
Send a Push Notification
Use\$activitysmith->notifications->send with a push payload. title is required; message and subtitle are optional.
PHP
Start a Live Activity
Start a Live Activity with\$activitysmith->liveActivities->start. For a segmented progress activity, include title, number_of_steps, current_step, and type.
PHP
Update a Live Activity
Update a Live Activity with\$activitysmith->liveActivities->update using the activity_id.
PHP
End a Live Activity
End a Live Activity with\$activitysmith->liveActivities->end. You can optionally set auto_dismiss_minutes in the content_state.
PHP
Channels
You can target specific channels when sending a push or starting a Live Activity.PHP
Error Handling
Handle API errors withtry/catch around SDK calls.