用于通过FCM发送消息的IP或URL firebase-admin命中什么?

问题描述 投票:0回答:1

我在尝试发送FCM通知时遇到问题。我认为这是由于服务器限制了对外部的访问。我需要知道的是,firebase-admin为身份验证或发送fcm命中的URL或IP是什么?因为错误消息中的IP似乎总是被更改。

Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Error fetching access token: Error while making request: connect EHOSTUNREACH 172.217.194.84:443. Error code: EHOSTUNREACH\"."}
(node:18224) UnhandledPromiseRejectionWarning: Error: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: Error while making request: connect EHOSTUNREACH 172.217.194.84:443. Error code: EHOSTUNREACH".
    at FirebaseAppError.FirebaseError [as constructor] (/home/administrator/node/FCMService/node_modules/firebase-admin/lib/utils/error.js:42:28)
    at FirebaseAppError.PrefixedFirebaseError [as constructor] (/home/administrator/node/FCMService/node_modules/firebase-admin/lib/utils/error.js:88:28)
    at new FirebaseAppError (/home/administrator/node/FCMService/node_modules/firebase-admin/lib/utils/error.js:122:28)
    at /home/administrator/node/FCMService/node_modules/firebase-admin/lib/firebase-app.js:121:23
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:18224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:18224) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
node.js firebase firebase-cloud-messaging firebase-admin
1个回答
0
投票

用于发送消息的主机名以fcm.googleapis.com开头,通常通过HTTPS访问。对于这样的情况,确实有助于了解Firebase Admin SDK是开源的,并且Node.js SDK的相关代码为here

© www.soinside.com 2019 - 2024. All rights reserved.