Android GCM消息发送未接收


Android GCM messages sending Not receiving

我是Android GCM服务的新手,我正在用PHP发送消息作为响应

{"multicast_id":5035179847798608085,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1399447523487490%5695579af9fd7ecd"}]}

在我的android应用程序中,它看起来是发送的,但没有接收到

下面是我的PHP代码:
     $registrationId="APA91bHx1bvBURGF4YSMDWGd5fPb33YtWfwEDspbsT-ejAYR0K_rao7NCSUtki7bP_1BvoCWn8fNpqAIPSjchvcy2JGtdJPvVC85cU9fhFoiE-Cos7PyhUhqIkpXznrD2rNhg9sVlWF2J5c9vSLLHP0LJDq5Q5M29dnUGzaROWcGBqsw3673VKM";
    // API access key from Google API's Console
    // Message to send
    $message      = "the test message";
    $tickerText   = "ticker text message";
    $contentTitle = "content title";
    $contentText  = "content body";
    //$registrationId = 'DEVICE_ID';
    $apiKey = "AIzaSyBx6hRnATNJGeYqeF4fzZLrNriuV2TRacI";
    $response = sendNotification(
        $apiKey,
        $registrationId,
        array('message' => $message, 'tickerText' => $tickerText, 'contentTitle' => $contentTitle, "contentText" => $contentText)
    );

    echo $response;


      $data = array(
            'data'=>$messageData,
            'registration_ids' => array($registrationIds)
        );

        var_dump( $headers);
        var_dump ($data);
        $ch = curl_init();
        $data= json_encode($data);
        curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
        curl_setopt( $ch, CURLOPT_URL, "https://android.googleapis.com/gcm/send" );
        curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
        curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $data );
        var_dump ($data);
        $response = curl_exec($ch);
        curl_close($ch);
        return $response;
    }

需要帮助

您是否使用Wifi网络?防火墙必须允许在Gcm配置上找到5228打开您可以使用一个工具来帮助检查连接GCM Server for windows