PHP code example of gidix / pushnotifier-php

1. Go to this page and download the library: Download gidix/pushnotifier-php 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/ */

    

gidix / pushnotifier-php example snippets


    $app = new GIDIX\PushNotifier\SDK\PushNotifier([
        'api_token'     =>  'YOUR_API_TOKEN',
        'package'       =>  'YOUR.PACKAGE.NAME'
    ]);

    $appToken = $app->login('username', 'password');

    $app = new GIDIX\PushNotifier\SDK\PushNotifier([
        'api_token'     =>  'YOUR_API_TOKEN',
        'package'       =>  'YOUR.PACKAGE.NAME',
        'app_token'     =>  $appToken
    ]);

    $devices = $app->getDevices();

    $result = $app->sendMessage($devices, 'Some Content');

    $result = $app->sendURL($devices, 'https://some.example.org/with/path.html');

    $result = $app->sendNotification($devices, 'Some Content', 'https://some.example.org/with/path.html');