navvygator / pusher
PHP push notifications to APNS, FCM fork from mxp100/pusher by Yuriy Potemkin
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 4
pkg:composer/navvygator/pusher
Requires
- php: ^7.0
- ext-json: >=1.3.7
Suggests
- ext-curl: *
This package is not auto-updated.
Last update: 2025-10-04 20:25:24 UTC
README
Compatable: PHP 7+
Installation
Composer
composer require mxp100/pusher
APNS certicates generate
Please see Wiki: https://github.com/mxp100/Pusher/wiki/Generating-the-Apple-Push-Notification-SSL-certificate-on-Mac
Examples
Example for FCM:
$serverKey = '[server key]'; $deviceId = '[device token]'; $devices = new DeviceCollection([new Device($deviceId)]); $message = new Message('This is a test message'); $adapter = new Fcm($serverKey); $pusher = new Pusher([new Push($adapter, $devices, $message)]); $pusher->push();
Example for GCM:
$serverKey = '[path to certification]'; $deviceId = '[device token]'; $devices = new DeviceCollection([new Device($deviceId)]); $message = new Message('This is a test message'); $adapter = new Gcm($serverKey, AdapterInterface::ENVIRONMENT_DEVELOPMENT); $pusher = new Pusher([new Push($adapter, $devices, $message)]); $pusher->push();
Example for APNS:
$serverKey = '[path to certification]'; $deviceId = '[device token]'; $devices = new DeviceCollection([new Device($deviceId)]); $message = new Message('This is a test message'); $adapter = new Apns($serverKey, AdapterInterface::ENVIRONMENT_DEVELOPMENT); $pusher = new Pusher([new Push($adapter, $devices, $message)]); $pusher->push();