我正在尝试将 vapid push 订阅导入 firebase。我在https://developers.google.com/instance-id/reference/server#import_push_subscriptions找到了一些解决方案。它出现以下错误。请帮助我解决这个问题。
发布:https ://iid.googleapis.com/v1/web/iid
标头:
Content-Type:application/json
Authorization:key=MY_SERVER_KEY
身体:
{
"endpoint" : "https://fcm.googleapis.com/fcm/send/my_sub_key",
"keys" : {
"p256dh" : "hidden_key",
"auth" : "hidden_auth"
}
}
}
回复:
"error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/登录/web/devconsole-project .", "status": "UNAUTHENTICATED" }