本文整理汇总了PHP中GCM::sendgroupalert方法的典型用法代码示例。如果您正苦于以下问题:PHP GCM::sendgroupalert方法的具体用法?PHP GCM::sendgroupalert怎么用?PHP GCM::sendgroupalert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCM
的用法示例。
在下文中一共展示了GCM::sendgroupalert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$allregid = array();
$chattype = 'update';
foreach ($memberarray as $memid) {
$query1 = "SELECT * FROM groupdetail where memberid='{$memid}' AND groupid='{$groupid}';";
$result = mysqli_query($conn, $query1) or die(mysql_error());
if (mysqli_num_rows($result) < 1) {
$newquery = "INSERT INTO `groupdetail`(memberid,groupid) VALUES ('{$memid}','{$groupid}')";
$result2 = mysqli_query($conn, $newquery);
}
$result = mysqli_query($conn, "SELECT * FROM usertable where userid='{$memid}'") or die(mysql_error());
if (mysqli_num_rows($result) > 0) {
while ($row = $result->fetch_assoc()) {
include_once './GCM.php';
$regId = $row["gcmid"];
array_push($allregid, $regId);
$gcm = new GCM();
$registatoin_ids = array($regId);
}
//end of while
}
}
$res = $gcm->sendgroupalert($allregid, 'Group Updated!!', $groupname, $groupid, $chattype, $memberid, $adminid, $membername);
if ($result2 == 1) {
$response["success"] = 1;
$response["message"] = "Member inserted";
echo json_encode($response);
} else {
$response["success"] = 0;
$response["message"] = "Please try again!";
echo json_encode($response);
}