首页 > 解决方案 > FCMResponse 正文成功不返回 1

问题描述

我正在使用 FCMResponse 将 Costumer LatLng 发送给 Rider,以获取信息并接受乘车。片刻通知,停止工作。

这是响应正文,未显示错误原因。

{
  "body": {
    "canonical_ids": 0,
    "failure": 1,
    "multicast_id": 6551176985363142000,
    "results": [
      {}
    ],
    "success": 0
  },
  "rawResponse": {
    "body": {
      "contentLength": -1,
      "contentType": {
        "charset": "UTF-8",
        "mediaType": "application/json; charset=UTF-8",
        "subtype": "json",
        "type": "application"
      }
    },
    "code": 200,
    "handshake": {
      "cipherSuite": {
        "javaName": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
      },
      "localCertificates": [],
      "peerCertificates": [
        {
          "type": "X.509"
        },
        {
          "type": "X.509"
        }
      ],
      "tlsVersion": "TLS_1_2"
    },
    "headers": {
      "namesAndValues": [
        "content-type",
        "application/json; charset=UTF-8",
        "date",
        "Wed, 25 Jul 2018 04:35:34 GMT",
        "expires",
        "Wed, 25 Jul 2018 04:35:34 GMT",
        "cache-control",
        "private, max-age=0",
        "x-content-type-options",
        "nosniff",
        "x-frame-options",
        "SAMEORIGIN",
        "x-xss-protection",
        "1; mode=block",
        "server",
        "GSE",
        "alt-svc",
        "quic=\":443\"; ma=2592000; v=\"44,43,39,35\""
      ]
    },
    "message": "",
    "networkResponse": {
      "code": 200,
      "handshake": {
        "cipherSuite": {
          "javaName": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
        },
        "localCertificates": [],
        "peerCertificates": [
          {
            "type": "X.509"
          },
          {
            "type": "X.509"
          }
        ],
        "tlsVersion": "TLS_1_2"
      },
      "headers": {
        "namesAndValues": [
          "content-type",
          "application/json; charset=UTF-8",
          "content-encoding",
          "gzip",
          "date",
          "Wed, 25 Jul 2018 04:35:34 GMT",
          "expires",
          "Wed, 25 Jul 2018 04:35:34 GMT",
          "cache-control",
          "private, max-age=0",
          "x-content-type-options",
          "nosniff",
          "x-frame-options",
          "SAMEORIGIN",
          "x-xss-protection",
          "1; mode=block",
          "content-length",
          "123",
          "server",
          "GSE",
          "alt-svc",
          "quic=\":443\"; ma=2592000; v=\"44,43,39,35\""
        ]
      },
      "message": "",
      "protocol": "HTTP_2",
      "receivedResponseAtMillis": 1532493334329,
      "request": {
        "body": {
          "contentType": {
            "mediaType": "application/json",
            "subtype": "json",
            "type": "application"
          }
        },
        "cacheControl": {
          "immutable": false,
          "isPrivate": false,
          "isPublic": false,
          "maxAgeSeconds": -1,
          "maxStaleSeconds": -1,
          "minFreshSeconds": -1,
          "mustRevalidate": false,
          "noCache": false,
          "noStore": false,
          "noTransform": false,
          "onlyIfCached": false,
          "sMaxAgeSeconds": -1
        },
        "headers": {
          "namesAndValues": [
            "Authorization",
            "key=AAAAASJXAAs:APA91bE7KztCHbHksez-7Jy9-omeKu6xcUgZA21aJbb-5_VId3TIU8iiXGzIuh9paTDVQxNIGdOxzYy9eNz3qG7E1ljW9-5JUjoVSXQdJiqEJF1w0QzjPqW_lQR__U1XFc8facL7QEbQ",
            "Content-Type",
            "application/json",
            "Content-Length",
            "447",
            "Host",
            "fcm.googleapis.com",
            "Connection",
            "Keep-Alive",
            "Accept-Encoding",
            "gzip",
            "User-Agent",
            "okhttp/3.8.0"
          ]
        },
        "method": "POST",
        "tag": {
          "body": {
            "contentType": {
              "mediaType": "application/json",
              "subtype": "json",
              "type": "application"
            }
          },
          "headers": {
            "namesAndValues": [
              "Authorization",
              "key=AAAAASJXAAs:APA91bE7KztCHbHksez-7Jy9-omeKu6xcUgZA21aJbb-5_VId3TIU8iiXGzIuh9paTDVQxNIGdOxzYy9eNz3qG7E1ljW9-5JUjoVSXQdJiqEJF1w0QzjPqW_lQR__U1XFc8facL7QEbQ"
            ]
          },
          "method": "POST",
          "url": {
            "host": "fcm.googleapis.com",
            "password": "",
            "pathSegments": [
              "fcm",
              "send"
            ],
            "port": 443,
            "scheme": "https",
            "url": "https://fcm.googleapis.com/fcm/send",
            "username": ""
          }
        },
        "url": {
          "host": "fcm.googleapis.com",
          "password": "",
          "pathSegments": [
            "fcm",
            "send"
          ],
          "port": 443,
          "scheme": "https",
          "url": "https://fcm.googleapis.com/fcm/send",
          "username": ""
        }
      },
      "sentRequestAtMillis": 1532493333457
    },
    "protocol": "HTTP_2",
    "receivedResponseAtMillis": 1532493334329,
    "request": {
      "body": {
        "contentType": {
          "mediaType": "application/json",
          "subtype": "json",
          "type": "application"
        }
      },
      "headers": {
        "namesAndValues": [
          "Authorization",
          "key=AAAAASJXAAs:APA91bE7KztCHbHksez-7Jy9-omeKu6xcUgZA21aJbb-5_VId3TIU8iiXGzIuh9paTDVQxNIGdOxzYy9eNz3qG7E1ljW9-5JUjoVSXQdJiqEJF1w0QzjPqW_lQR__U1XFc8facL7QEbQ"
        ]
      },
      "method": "POST",
      "url": {
        "host": "fcm.googleapis.com",
        "password": "",
        "pathSegments": [
          "fcm",
          "send"
        ],
        "port": 443,
        "scheme": "https",
        "url": "https://fcm.googleapis.com/fcm/send",
        "username": ""
      }
    },
    "sentRequestAtMillis": 1532493333457
  }
}

我不知道为什么会这样,我不知道我可能做了什么让它突然停止工作,因为我没有留下来。

标签: firebasefirebase-cloud-messaging

解决方案


推荐阅读