本文整理汇总了PHP中GCM::send_groupnotification方法的典型用法代码示例。如果您正苦于以下问题:PHP GCM::send_groupnotification方法的具体用法?PHP GCM::send_groupnotification怎么用?PHP GCM::send_groupnotification使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GCM
的用法示例。
在下文中一共展示了GCM::send_groupnotification方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GCM
$cklogin = new GCM();
$result = $cklogin->checkuserlogin($userid, $deviceid);
if ($result == 'loggedin') {
$result_group = mysqli_query($conn, "SELECT * FROM groupdetail where groupid='{$groupid}'") or die(mysql_error());
if (mysqli_num_rows($result_group) > 0) {
while ($row = $result_group->fetch_assoc()) {
$memberid = $row['memberid'];
// group ids
$result_grp = mysqli_query($conn, "SELECT * FROM usertable where userid='{$memberid}' AND userid <> '{$fromid}';") or die(mysql_error());
if (mysqli_num_rows($result_grp) > 0) {
while ($row = $result_grp->fetch_assoc()) {
include_once './GCM.php';
$regId = $row["gcmid"];
$gcm = new GCM();
$registatoin_ids = array($regId);
$res = $gcm->send_groupnotification($registatoin_ids, $message, $sender_name, $fromid, $sender_lname, $logintype, $chattype, $groupid, $messagetype);
}
}
}
}
$query = "DELETE * FROM `groupmaster` where groupid=" . $groupid;
$result = mysqli_query($conn, $query);
$query1 = "DELETE * FROM `groupdetail` where groupid=" . $groupid;
$result1 = mysqli_query($conn, $query1);
if ($result == 1) {
$response["success"] = 1;
$response["message"] = "Delete Succeessfully";
echo json_encode($response);
} else {
$response["success"] = 0;
$response["message"] = "Please try again!";
示例2: die
$res = $gcm->sendgroupalert($allregid, 'New Group Created!', $groupname, $groupid, $chattype, $memberid, $adminid, $membername);
$sender_name = '';
$sender_lname = '';
$logintype = '';
$message = 'Welcome to Group ' . $groupname;
$result_sendername = mysqli_query($conn, "SELECT * FROM usertable where userid='{$adminid}'") or die(mysql_error());
if (mysqli_num_rows($result_sendername) > 0) {
while ($row = $result_sendername->fetch_assoc()) {
$sender_name = $row['firstname'];
/// sender details
$sender_lname = $row['lastname'];
$logintype = $row['logintype'];
}
}
$chattype = 'group';
$res2 = $gcm->send_groupnotification($allregid, $message, $sender_name, $adminid, $sender_lname, $logintype, $chattype, $groupid, $messagetype);
}
if ($result2 == 1) {
$response["success"] = 1;
$response["message"] = "Group Created Successfully...";
echo json_encode($response);
} else {
$response["success"] = 0;
$response["message"] = "Please try again!";
echo json_encode($response);
}
} else {
$response["success"] = "false";
$response["message"] = "User Not Logged in.";
echo json_encode($response);
}