示例#1
0
/**
* Requerimos el archivo de la clase y creamos el objeto PushNotification();
* Require file class.pushmobile.php and create new object PushNotification();
*/
require_once '../src/class.pushmobile.php';
$push = new PushNotification();
/**
* Enviar notificación push a dispositivo iOS, método:
* Send push notification to iOS device, method:
* 
* Set:
* $device_token (required)
* $message (required)
* $args (optional)
*/
$device_token = "123456abcd";
$message = "Hola, soy una alerta push a iOS";
$args = array();
$push->ios($device_token, $message, $args);
/**
* Enviar notificación push a dispositivo Android, mediante Google Cloud Messaging.
* Send push notification to Android device.
* Set:
* $device_token (required)
* $message (required)
* $args (optional)
*/
$device_token = "123456abcd";
$message = "Hola, soy una alerta push a Android";
$args = array();
$push->android($device_token, $message, $args);