function newNotif($cadena) { require_once 'PushBots.class.php'; $pb = new PushBots(); // Application ID $appID = '564c0296177959002d8b4569'; // Application Secret $appSecret = '350d1b5bbe16e0ce65ef350f41c92ce1'; $pb->App($appID, $appSecret); // Push to Single Device // Notification Settings //$pb->AlertOne($cadena); //$pb->PlatformOne("1"); //$pb->TokenOne("APA91bEVnyzlMUnYrQzKR8GutQLMckBKuTpK0XjB7qe4f-XYBxSQae-GjOrLRyqViwCpeMWmgYUBDeJLSrr0gQVX5pKnvCvZuNfXsHX99LwafL8i2QlFf27vM2nm5wfDBgJGVGDW6pfL"); $pb->Alert($cadena); $pb->Platform(array("0", "1")); $pb->Badge("+2"); $pb->Push(); //Push to Single Device //$pb->PushOne(); }
function sendmessage($message) { $pb = new PushBots(); // Application ID $appSecret = '01051c0a6ff7ce415584f3718c9c4cc7'; // Application Secret $appID = '56a886bc177959da488b4567'; $pb->App($appID, $appSecret); $customfields = array("PushBots" => "true"); $pb->Payload($customfields); // Notification Settings $pb->Alert($message); $pb->Platform(array("0", "1")); $pb->Badge("+2"); $pb->AliasData(1, "APA91bFpQyCCczXC6hz4RTxxxxx", "test"); // set Alias on the server $pb->setAlias(); // Push it ! $pb->Push(); return null; }
<?php // Push The notification with parameters require_once 'PushBots.class.php'; $pb = new PushBots(); // Application ID $appID = '518d187xx'; // Application Secret $appSecret = '25e8507956b62d81xxx'; $pb->App($appID, $appSecret); // Notification Settings $pb->Alert("test Mesage"); $pb->Platform(array("0", "1")); $pb->Badge("+2"); // 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 it ! $pb->Push(); // Push to Single Device // Notification Settings $pb->AlertOne("test Mesage"); $pb->PlatformOne("0"); $pb->TokenOne("3dfc8119fedeb90d1b8a9xxxxxx");