Closed Bishalsingh closed 7 years ago
@Bishalsingh can you provide more info? How is the object you're sending? any especial character?
@Bishalsingh I had got the same issue one hour ago. I just added one line with console.log
to the library code and was able to see the actual reason of the error. In my case the error was caused by wrong Server key. I added redundant quotes around the key. Once I removed them everything became working properly.
Note that your server key might have changed in your firebase console. it happened to one of my projects once.
You can recheck your key at https://console.firebase.google.com/project/_/settings/cloudmessaging
I am having the same issue. I already checked my key and it's fine.
Same issue, key is fine if I fire manually via curl
. For me it was that the message was not correct:
const message = {
to: fcmTokens,
notification: {
...
needs to be:
const message = {
registration_ids: fcmTokens,
notification: {
...
@wuestkamp indeed, the key to
was meant to be used in messages to ONE SINGLE device. For multicast messages, we need to use the key registration_ids
. If i get some free time these days I can make an implementation to check these cases and informe more clearly than FCM itself
change key of inner variable of data.. if u use (message_type) as key ... server will send InvalidServerResponse
@1211amarsingh I too facing same issue your message helped me a lot. thank you so much
@jlcvp did you find any solution of this
@varun22mittal I'm not maintaining this lib anymore, I strongly recommend you to use the firebase's official node sdk
Since last two days, InvalidServerResponse error gets displayed every single time. No code changes and this thing was working before.