404未找到nginx / 1.12.0推送通知

时间:2017-08-16 12:18:53

标签: php android jquery nginx google-cloud-messaging

我遇到了大麻烦,我不知道它会是什么。

我有一个桌面上有超过10万用户的APP,大约1分钟后我碰巧在LOOP内调用GCM服务出现此错误信息。

我已经处理了所有字段以便不为NULL,我不知道它是什么!

ajax会暂停吗?

GCM中的电话如下:

$url    = 'https://android.googleapis.com/gcm/send';
    $fields = array(
        'data' => array(
            "mensagem" => $message
        ),
        'registration_ids' => $registatoin_ids
    );
    if (is_array($data)) {
        foreach ($data as $key => $value) {
            $fields['data'][$key] = $value;
        }
    }

    $headers = array(
        'Authorization: key=' . apiKey,
        'Content-Type: application/json'
    );
    $ch      = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
    $result = curl_exec($ch);
    if ($result === FALSE) {
        die('Curl failed: ' . curl_error($ch));
    }

    curl_close($ch);

循环以带来数据库ID -------------

for ($i = 0; $i < $num / 1000; $i++)
    {
    $query = $con->query("SELECT gcm_regid from registration where status ='S' and LENGTH(gcm_regid) = 152  and app_id=$Id_Aplicativo LIMIT $current_num,1000");
    foreach($query as $data)
        {
        if (!is_null($data["gcm_regid"]))
            {
            $row[] = is_null($data["gcm_regid"]) ? " " : $data["gcm_regid"];
            $cont = $cont + 1;
            }
        }

    // print_r($row);

    $pushStatus = send_notification($con, $row, $mensagem, array(
        'titulo' => is_null($titulo) ? " " : $titulo, //$titulo,
        'sub_mensagem' => is_null($sub_mensagem) ? " " : $sub_mensagem, //$sub_mensagem,
        'content_mensagem' => is_null($content_mensagem) ? " " : $content_mensagem, //$content_mensagem,
        'content_info' => is_null($content_info) ? " " : $content_info, //$content_info,
        'url_imagem' => is_null($path . $nome_imagem) ? " " : $path . $nome_imagem, //$path.$nome_imagem,// Esse Path vem do arquivo Conect.php
        'url_audio' => is_null($path_audio . $filenameAudio) ? " " : $path_audio . $filenameAudio, //$path_audio.$filenameAudio, // Esse Path vem do arquivo Conect.php
        'tipo_notificacao' => is_null($TipoNotificacao) ? " " : $TipoNotificacao, //$TipoNotificacao
    ));
    $row = null;
    $current_num+= 1000;
    }

404 Not Found Nginx / 1.12.0

enter image description here

0 个答案:

没有答案