当前位置: 首页>>代码示例>>PHP>>正文


PHP GCM::send_groupnotification方法代码示例

本文整理汇总了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!";
开发者ID:joaokiosfera,项目名称:MedicalServiceWebservice,代码行数:31,代码来源:deleteGroup.php

示例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);
}
开发者ID:joaokiosfera,项目名称:MedicalServiceWebservice,代码行数:31,代码来源:createnewgroup.php


注:本文中的GCM::send_groupnotification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。