Using Novu to send push notifications via FCM
Hi. I try to use Novu to send push notifications via FCM. According to the docs https://docs.novu.co/integrations/providers/push/fcm I enabled the FCM integration - got my service account key from the Firebase Console, pasted the entire JSON file content in the Service Account field of the FCM provider in the integration store on Novu’s web dashboard. Then following this guide https://docs.novu.co/integrations/providers/push/fcm#setting-device-token I try to add the subscriber’s device token. And from this place there are some confusions.
15 Replies
This is the guide curl code:
curl -L -X PUT 'https://api.novu.co/v1/subscribers/<SUBSCRIBER_ID>/credentials' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: ApiKey <NOVU_API_KEY>' \
-d '{
"providerId": "fcm",
"credentials": {
"deviceTokens" : [
"token1",
"token2"
]
},
"integrationIdentifier": "fcm-MnGLxp8uy"
}'
And this is the api reference:There are a lot of unfamiliar options that do not correspond with the guide. And there is no another full guide to send a push notifications that explains all the params and properties
For example what is
providerId
, where do I get it from?providerId
is fcm
This api is used for storing other credentials as well. That's why you see more properties with deviceTokens
cannot type "fcm" here
it is of enum type
you can select from the dropdown
the dropdown is empty
let me check
yes please, waiting for your response
Looks like there is some issue
Can I share example cURL here?
Can you explain please "deviceTokens"? Where do I get them from?
deviceTokens are generated on the client side.
When you go to a website that can send push notification. It asks for push notification permission. when you allow push notification permission to that website, a devicetoken is generated. So you need to handle this in client side and store it in Novu using our api or SDK
https://v0.x-docs.novu.co/guides/FCM-iOS-Novu/how-to-send-PUSH-notifications-to-iOS-devices-with-FCM-using-Novu
https://v0.x-docs.novu.co/guides/fcm-flutter-novu/how-to-send-push-notifications-to-flutter-apps-with-fcm-using-Novu
https://v0.x-docs.novu.co/guides/novu-fcm-web
can it be any string just for testing needs?
No, it should be a valid FCM devicetoken, generated using credentials of same project
@Sapar
Did you manage to send push notification using Novu?