appdb/php-push-sender

PHP library to send push notifications via appdb push service

1.0.1 2024-04-24 09:26 UTC

This package is auto-updated.

Last update: 2025-02-24 11:19:47 UTC


README

This library allows you to send push notifications to your apps that are published on appdb.

More information about appdb push notification service can be found on Documentation website

Installation

composer require appdb/php-push-sender

Sending of push notification (sample code)

require_once 'vendor/autoload.php';

$sender = new \Appdb\PhpPushSender\PhpPushSender('push_xxx', 'xxx');


$payload = [
    'aps' => [
        'alert' => [
            'title' => 'test',
            'subtitle' => 'test notification',
            'body' => 'test at ' . date('r')
        ]
    ]
];

$destinations['c_xxx'] = []; // sending to this customer
// OR
$destinations['c_xxx'][] = 'd_xxx';  // sending to specific device of customer


$pushSendResult = $sender->send($payload, $destinations);

var_dump($pushSendResult);