I am using FCM HTTP v1 API with below code, It’s working fine on localhost. AccessToken is getting successfully. But after deployment, it doesn’t works on server, getting timeout issue every time (Error: socket hang up on postman from server url). Could you please help out in this. Is there any internal FCM APIs endpoints that need to whitelist on our server? If yes, then could you please provide all internal FCM APIs endpoints that is breaking due to server fireball.
Below snippet I am using to get accessToken from FCM HTTP v1
const { GoogleAuth } = require("google-auth-library");
const auth = new GoogleAuth({
credentials: {
client_email: CLIENT_EMAIL,
private_key: PRIVATE_KEY,
},
scopes: ["https://www.googleapis.com/auth/firebase.messaging"],
});
const client = await auth.getClient();
const accessToken = await client.getAccessToken();
return accessToken.token;
Any response would be highly appreciated!
Satya Prakash Pandey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.