Unexpected provider error
Hi,
I'm currently running novu locally using docker compose. I set up a basic workflow that sends a push notification. I set up the FCM provider. I then use the following script to send a notification:
I downloaded the FCM toolbox app from the play store, which gives me a device token. So I can test things without having to code an app for it.
If I now run my script, I see the notification in the acitvity monitor but it tells me, that there is an unexpected provider error. The details are just
{}
.
How should I debug this?
Also see https://i.imgur.com/L2TAYTu.png20 Replies
@balance, you just advanced to level 3!
Hi @balance
Possible chances are it firebase configs are not matching.
Service account JSON you stored in fcm integration is of same project?
The only place I used the service account json was in the FCM Integration. Neither the FCM Toolkit app I use to test it not my code to send notification uses it.
So I can't see where anything would have to match.
How this FCM toolkit app works?
What input it takes?
It just gives you a device tolen but maybe I have to use their service account? https://github.com/SimonMarquis/FCM-toolbox/blob/master/app/google-services.json
They use a public one or you compile it yourwelf with your own services config file, which I fidn't.
I'm inexperienced with FCM.
Yes you will have to use their service account JSON file if fcm token is generated using their fcm configs
So to clarify:
I set up the FCM integration using the above google-services.json. I can then send a notification with the above code to the app, right?
Yes
Okay, that doesn't work. How can I set the logger to be more verbose? So I get an actual error.
I just don't know how to debug this if the error is
{}
@zacclifton can we increase log level while running novu in local machine?
ah I just saw, if I use the FCM toolbox google-service.json for the FCM integration, I get
{
"code": "app/invalid-credential",
"message": "Service account object must contain a string \"project_id\" property."
}
https://docs.novu.co/channels/push/fcm#generate-service-account-key-json
Is there a mismatch in configration version?is your json content matching this format
{
"type": "service_account",
"project_id": "PROJECT_ID",
"private_key_id": "PRIVATE_KEY_ID",
"private_key": "PRIVATE_KEY",
"client_email": "FIREBASE_ADMIN_SDK_EMAIL",
"client_id": "CLIENT_ID",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "CLIENT_X509_CERT_URL"
}
No, it's https://github.com/SimonMarquis/FCM-toolbox/blob/master/app/google-services.json
Can't I just receive notification for testing purposes in the FCM console or something like that?
for that also you will need fcm token generated using that that config
I just assume Novu adopts the file format provided by google.
I do.
I use the FCM Toolkit to generate a device token. The app uses the above google services file but it doesn't match novus format - for whatever reason.
I'm fine using whatever - I just don't want to write a whole example application to simply receive notifications for testing purposes. There must be a simple way, can't be that uncommon o.O
Yes, in the env file set the env variable to verbose or debug.
keep in mind not everything is logged properly at this moment.
thanks, I'm quit sure that my issue has to do with the mismatch between my app that receives notifications and the setup of the integration though.
So how would you receive notifications for testing purposes? Do you guys have an app for that?
Hi @balance
Currently, We don't have an example app. I will ping in this thread, once it will be available
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Hi
Did you change anything from your end?
is FCM service account json is of same format as in this doc
https://docs.novu.co/channels/push/fcm