Requirements

  1. PHP 5.1+

  2. cURL

Usage

// Push The notification with parameters
require_once('PushBots.class.php');
$pb = new PushBots();
// Application ID
$appID = '';
// Application Secret
$appSecret = '';
$pb->App($appID, $appSecret);

// Notification Settings
$pb->Alert($msg);
$pb->SoundOne($sound);
$pb->Badge($badge);
$pb->Platform($platforms);

// Tags Array
$pb->Tags($tags);

// Custom fields - payload data
$customfields= array("author" => "Jeff","nextActivity" => "com.example.sampleapp.Next");
$pb->Payload($customfields);


// Country or state
$pb->Geo($country , $gov);

// Push it !
$pb->Push();

// Update Alias
/**
* set Alias Data
* @param integer $platform 0=> iOS or 1=> Android.
* @param String $token Device Registration ID.
* @param String $alias New Alias.
*/

$pb->AliasData(1, "APA91bFpQyCCczXC6hz4RTxxxxx", "test");
// set Alias on the server
$pb->setAlias();

// Push to Single Device
// Notification Settings
$pb->AlertOne("test Mesage");
$pb->PlatformOne("0");
$pb->TokenOne("3dfc8119fedeb90d1b8a9xxxxxx");

//Push to Single Device
$pb->PushOne();
Did this answer your question?