Generating a Service Account Key JSON
To acquire the account key JSON file for your service account- Select your project, and click the gear icon on the top of the sidebar.
- Head to project settings.
- Navigate to the service account tab.
- Click Generate New Private Key, then confirm by clicking Generate Key.
- Clicking Generate Key downloads the JSON file.
FCM Overrides
The overrides field supports apns, android, webpush and fcmOptions overridesOverride Field | Type / Interface | Link |
---|---|---|
android | AndroidConfig | https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.androidconfig |
apns | ApnsConfig | https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.apnsconfig |
webPush | WebpushConfig | https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.webpushconfig |
fcmOptions | FcmOptions | https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.fcmoptions |
Setting Device Token
Before triggering the notification to a subscriber(user) with push as a step in the workflow, make sure you have added the subscriber’s device token as follows:SDK Trigger Example
deviceIdentifiers
field in overrides.
Novu uses FCM version V1
Relative Link in Webpush
Suppose you’re using the Firebase (FCM) provider to send push notifications to web browsers via Novu and want users to be returned to the website after clicking the notification. In that case, you must use thelink
property with a relative URL.
FAQs
The registration token is not a valid FCM registration token
The registration token is not a valid FCM registration token
You may come across an error like so:""Sending message failed due to “The registration token is not a valid FCM registration token""".This error happens because of invalid or stale token. The fix for this is to remove old tokens, generate a new token and save it into user subscribers.
FCM notifications sent successfully with no error but push notification is not received in device
FCM notifications sent successfully with no error but push notification is not received in device
Try to generate a new token after clearing device cache and retry with this fresh token.
Sending message failed due to 'Requested entity was not found'
Sending message failed due to 'Requested entity was not found'
This error occurs when your token is no longer valid. To fix this, generate a new token and use it.
Subscriber does not have a configured channel error
Subscriber does not have a configured channel error
This error occurs if the fcm integration is active but subscriber is missing from the fcm credentials (deviceTokens). The credentials (deviceTokens) for the subscriber needs to be set.