我可以使用php中的GCM推送插件一次向多个设备发送多条消息吗


can i send multiple messages to multiple devices at a time using GCM push plugin in php

如何一次向多个设备发送多条消息

$apiKey = "xxxxx";
$registrationIdArray = array('xxx_1','xxx_2'); 
$msg = array('message' => 'message_1','title'=> 'title_1','message' => 'message_2','title'=> 'title_2'); 
$pusher = new Pusher($apiKey); 
$pusher->notify($registrationIdArray, $msg);

我已经编辑了我的代码,请使用这个

 <?php
 include_once './GCM.php';
$regid = $_POST['regid'];//your registration id array 
$fields1=$_POST['message'];//your message array
$total_message = count($fields1);//count total no of message
$total_records = count($regid);//Count total number of registration id
for($j=0;$j< $total_message;$j++)//loop for sending multiple messgae
{
for($i=0;$i< $total_records;$i++)//loop for sending to multiple device
{
    $registatoin_ids = array($regid[$i]);
    $message = array("price" => $total_message[$j]);
    $result = $gcm->send_notification($registatoin_ids, $message);
}
}
?>