firebase.getToken()不是有效的令牌

时间:2018-02-09 11:47:32

标签: firebase google-api firebase-authentication firebase-cloud-messaging angularfire

给我注册令牌的函数返回以下字符串

eyJhbGciOiJSUzI1NiIsImtpZCI6ImQyZjQ0ZGVmNmE5MDkyYzlhYmYwNzJiMzM3ZDQ3OTVkZTFmZmNjY2UifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZGFyay1zdHJhdHVtLTE5NDAxOSIsImF1ZCI6ImRhcmstc3RyYXR1bS0xOTQwMTkiLCJhdXRoX3RpbWUiOjE1MTgxNzUzODcsInVzZXJfaWQiOiI1YTY5ZTM4NjEzZWJkYmU4MGQ0MzhiOTciLCJzdWIiOiI1YTY5ZTM4NjEzZWJkYmU4MGQ0MzhiOTciLCJpYXQiOjE1MTgxNzUzODgsImV4cCI6MTUxODE3ODk4OCwiZmlyZWJhc2UiOnsiaWRlbnRpdGllcyI6e30sInNpZ25faW5fcHJvdmlkZXIiOiJjdXN0b20ifX0.rN76re5hzXkf03MFezbE5fvqJQ0XR46HZNOm9vAlPYr5hdr5LxP7Abbu5QK733WXVtwENwcv86HH2Q_jfxMlAzKwQRlHcU9g7-2wS1Q-jPIDfmc9-DziR4IgtrmJ3wt3mKl-3yS60PJdNhXOsg0PEt70GoWwEsaIsti4MEw87c470z9M8YRtCS_Q7yeEBZCs0MOTUmvfiFLVkrboPEgOf9zv7GFfRAuF3Zt-qOx9I-4GdUksuA2_mFCXXUEZ_eHkEWEdNl_wCT1ggMy7VMlQgFmRl00FXEgGSUIBLghejGDuJFT08CVsh5oLrHp2pKNSIShRnmL9RLJgnXTEzUz39A

当我使用此字符串作为令牌发送消息时,它会给我一个错误:

{
"results": [
    {
        "error": {
            "code": "messaging/invalid-registration-token",
            "message": "Invalid registration token provided. Make sure it matches the registration token the client app receives from registering with FCM."
        }
    }
],
"canonicalRegistrationTokenCount": 0,
"failureCount": 1,
"successCount": 0,
"multicastId": 5998201396286625000
}

我认为注册令牌应采用以下格式:

cbuJIjkg9zQ:APA91bHavuWCuRuWIBrDOoHUK-RsjU1yewigurrYzHe0cP‌​iTQINykKjrLf8E0qEwJj‌​3XmJ1IoTmn0r2EoLR_mA‌​HGOjlA61CnQ8aSn2WxWK‌​KByOwbsnqoVeaeWQIeGU‌​_yh4wnZ67soLtI

0 个答案:

没有答案