FCM Push Notifications
I am testing FCM push notifications, but when the workflow is executed I get this error message for the step in question:
"Unexpected token } in JSON at position 2354"
18 Replies
Any news ?
Hi @dave93
Above error means your service account json is not in correct format
https://docs.novu.co/channels-and-providers/push/fcm#generating-a-service-account-key-json
Could you please check?
Yes, now the error is :
"Sending message failed due to "Requested entity was not found.""
could you please share the error screenshot?
This is the workflow
Any news ?
Hi @dave93.
Are you self hosing Novu?
If you are using novu cloud
Could you please share the transactionId so we can debug
I use the self hosting Novu
@dave93.
Few possible reasons:-
1. service account credentials and credentials you used to generate device token is not matching
2. Your token is invalid
3. service account json is not valid
https://stackoverflow.com/questions/56216887/requested-entity-was-not-found-when-trying-to-send-a-push-notification-using-fir#:~:text=So%20apparently%2C%20this%20error%20happens,and%20be%20done%20with%20it.
Thanks I solved it
@dave93 Would you mind sharing what was the reason in your case?
The token was no longer valid, deleting it and generating a new one worked.I had opened another post for @novu/node that does not allow me to set up webPush, android, apns as you can see from the image.
I use version 0.21.0
Hello everyone
I have a question:
does Novu use the firebase FCM best practice https://firebase.google.com/docs/cloud-messaging/manage-tokens
Does Novu remove the old tokens automatically?
@Mauve
Currently Novu does not remove stale tokens automatically. User have to do it on their own
We have an internal ticket for this. Hopefully we will support this in future
is there anything else I need to be aware of when using novu with Firebase FCM?
should I send the token on each app start? is there any recommendations about that?
Checkout our FCM docs
https://docs.novu.co/channels-and-providers/push/fcm
In my knowledge, on each app start, a new token is not generated
We have unique check in deviceTokens array
so duplicate tokens will be discarded