代码之家  ›  专栏  ›  技术社区  ›  Dean Blakely

将GCM应用程序转换为FCM时端点出现问题

  •  0
  • Dean Blakely  · 技术社区  · 8 年前

    我正在使用将我的GCM应用程序转换为FCM this guide

        HttpWebRequest Request = (HttpWebRequest)WebRequest.Create("https://android.googleapis.com/gcm/send");
        Request.Method = "POST";
        Request.KeepAlive = false;
        Request.ContentType = "application/json";
        Request.Headers.Add(string.Format("Authorization: key={0}", apiKey));
        Request.ContentLength = byteArray.Length;
        Stream dataStream = Request.GetRequestStream();
        dataStream.Write(byteArray, 0, byteArray.Length);
        dataStream.Close();
    

    在“更新服务器端点”中,它表示

    gcm-http.googleapis.com/gcm/

    fcm.googleapis.com/fcm/

    但是,我没有使用该端点。我一直在使用

    android.googleapis.com/gcm/send

    几年来都非常成功。我不记得我为什么要发邮件了。我是否应该将其附加到新端点?

    1 回复  |  直到 8 年前
        1
  •  0
  •   AL.    8 年前

    文档似乎有较旧的版本。 android.googleapis.com/gcm/send gcm-http.googleapis.com/gcm/ IIRC。

    不管怎样,我都会证实这一点 android.googleapis.com/gcm/send fcm.googleapis.com/fcm/ 终点(这是一个 old answer (供我参考)。