Java com.google.android.gcm.server.InvalidRequestException:发送FCM消息

Java com.google.android.gcm.server.InvalidRequestException:发送FCM消息,java,firebase,push-notification,google-cloud-messaging,Java,Firebase,Push Notification,Google Cloud Messaging,您好,我在发送FCM消息时收到此响应 发布消息时出错com.google.android.gcm.server.InvalidRequestException:HTTP状态代码:400(Error=deprecatedpoint),我在我的play 2.1.2项目中使用的代码是gcm server.jar 我已经使用那里发送了消息,我得到了相同数据的成功响应,但如果我尝试通过代码,它会抛出一个错误 new Thread(new Runnable() { @Override

您好,我在发送FCM消息时收到此响应

发布消息时出错com.google.android.gcm.server.InvalidRequestException:HTTP状态代码:400(Error=deprecatedpoint),我在我的play 2.1.2项目中使用的代码是gcm server.jar

我已经使用那里发送了消息,我得到了相同数据的成功响应,但如果我尝试通过代码,它会抛出一个错误

new Thread(new Runnable() {
            @Override
            public void run() {
                MulticastResult multicastResult;
                try {

                    Sender sender = new Sender(Constants.ANDORIED_APP_ID_FCM);
                    multicastResult = sender.send(message1, devices, Constants.ANDROID_GCM_RETRY_COUNT);
                } catch (Exception e) {
                    CabhoundLogger.error("Error posting messages" + e, className);
                    errorCount++;

                    return;
                }


阅读错误消息。这很有描述性。GCM被弃用(准确地说是在2018年5月)。切换到FireBase云消息。但我仅使用FCM发送消息。在服务器端,我的项目代码包含gcm-server.jar。我希望这还没有遭到反对。但是我在发送消息时收到了失败消息,
gcm server
已被弃用,因为异常和我链接的文档都告诉您。@Jenifer:您得到了任何解决方案吗?没有@DhavalPatel,但我已经用FCM server jar替换了我的代码