我正在尝试开发GCM推送通知,但我收到以下错误。
12-06 12:19:51.780:E / URL(5975):> http://192.168.xxx.108:8085/gcm_server_php/register.php
我正在使用Wamp服务器。我将gcm_server_php文件夹保存在www文件夹中.IP是我的计算机IP,我打开服务器,我也打开端口8085.但仍然收到错误。
register.php
<?php
// response json
$json = array();
/**
* Registering a user device
* Store reg id in users table
*/
if (isset($_POST["name"]) && isset($_POST["email"]) && isset($_POST["regId"])) {
$name = $_POST["name"];
$email = $_POST["email"];
$gcm_regid = $_POST["regId"]; // GCM Registration ID
// Store user details in db
include_once './db_functions.php';
include_once './GCM.php';
$db = new DB_Functions();
$gcm = new GCM();
$res = $db->storeUser($name, $email, $gcm_regid);
$registatoin_ids = array($gcm_regid);
$message = array("product" => "shirt");
$result = $gcm->send_notification($registatoin_ids, $message);
echo $result;
} else {
// user details missing
}
?>