PHP code example of semivan / pushall-api-client

1. Go to this page and download the library: Download semivan/pushall-api-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

semivan / pushall-api-client example snippets


$client = new \PushAll\PushAllClient($id, $key);

$userId = $client->oAuth($_GET('code'));

// Уведомление себе
$result = $client->selfNotification()
    ->setTitle('Title')
    ->setText('Text')
    ->send();

// Уведомление всем подписчикам канала
$result = $client->broadcastNotification()
    ->setTitle('Title')
    ->setText('Text')
    ->send();

// Уведомление определенным подписчикам канала
$result = $client->multicastNotification()
    ->setTitle('Title')
    ->setText('Text')
    ->addUid(11111)
    ->addUid(22222)
    ->send();

// Уведомление одному подписчику канала
$result = $client->unicastNotification()
    ->setTitle('Title')
    ->setText('Text')
    ->addUid(11111)
    ->send();

// Уведомлений
$result = $client
    ->showList()
    ->getNotifications();

// Подписчиков
$result = $client
    ->showList()
    ->getUsers();