2

I would like to implement Django-fcm when I try to test it, I was able to install Django FCM everything went successfully.

Here is the error that appears MismatchSenderId.

Here are some illustration screenshots:

The error on postman

The headers on postaman

Any help is appreciated.

AL.
  • 36,815
  • 10
  • 142
  • 281
Mane alioune
  • 33
  • 1
  • 12
  • 1
    `MismatchSenderId` is thrown when you're using the Server Key from a different project, not associated with the Registration token you're sending the message to (see my answer [here](http://stackoverflow.com/a/43244992/4625829)). I'm not familiar with Django, but was there any part in your code that you specified a *Sender ID*? If there was, I'd double check it's value. – AL. Apr 20 '17 at 01:45
  • Thanks for your answer but I am not specifying the sender ID in my code – Mane alioune Apr 20 '17 at 10:00
  • That's odd. Not even a default? Is there even a manifest file there? (Sorry, really not familiar with Django) – AL. Apr 20 '17 at 10:02
  • Django makes available a settings file that allows you to configure Firebase Cloud Messaging in this file I put the FCM_APIKEY and FCM_SENDER_ID but when I test the same error appears MismatchSenderId – Mane alioune Apr 20 '17 at 12:32
  • Could you try setting the Sender ID to `103953800507`, try to get a new token, and retry sending a message? – AL. Apr 20 '17 at 13:06
  • When I try this sender ID with a new token the same error is displayed – Mane alioune Apr 20 '17 at 16:52

1 Answers1

0

I had the same error, I debugged and found out that in the Django project I was not using the right json file. To make sure, you are not adding the wrong json file, go to the

firebase console > select your app -> go to settings ->select service accounts tab -> select python ->

download the server key json file and add the code mentioned to the settings file.

Shamsul Arefin
  • 1,771
  • 1
  • 21
  • 21