appricos / pushinator-php
A PHP client for the Pushinator API
v1.0.0
2025-01-27 20:15 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^11.5
README
A PHP Composer package that enables developers to send push notifications seamlessly through the Pushinator API.
Installation
Install the package using Composer:
composer require appricos/pushinator-php
Make sure Composer's autoloader is included in your project:
require 'vendor/autoload.php';
Usage
Initializing the Client
To start using the PushinatorClient, create an instance by passing your API token:
use Pushinator\PushinatorClient; $client = new PushinatorClient('PUSHINATOR_API_TOKEN');
Sending Notifications
To send a notification to a specific channel, use the sendNotification
method. Provide your channel ID and the notification content as arguments:
use Pushinator\PushinatorClient; $client = new PushinatorClient('PUSHINATOR_API_TOKEN'); try { $client->sendNotification('PUSHINATOR_CHANNEL_ID', 'Hello from PHP!'); } catch (Exception $e) { echo "Error: " . $e->getMessage(); }