Android Question Firebase strange thing

gerardguerin

Member
Licensed User
Longtime User
I made my first application that uses Firebase and it works fine. I resume the sources of this one and modifies some cosmetic element, changes the Package ID and the JSON file, of course with a new Firebase project and I do not receive any more notifications, I have this as error:

The sender ID does not match the registration token. Check the sender ID used in the getToken query.

Any idea?
 

gerardguerin

Member
Licensed User
Longtime User
How are you sending the messages?
I send the message by the console

Have you updated the server key?
No need for now I use console, I have create a new project in the Firebase console and download the JSON fil, put in the project, the package name is the same
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Note that you shouldn't send them with the console. Only with the http request from the B4J code.

Yep. But for a quick test, it's ok...

Please check if the JSON is *really* the new one ;-) Did you *really* enable FCM for your new project?

Do you send to a device or a topic? Make sure, you update the token via

B4X:
Public Sub UpdateFCMToken
   fm.SubscribeToTopic("general") 'you can subscribe to more topics
   Log (fm.Token) ' Copy the token and send a message to this...
End Sub
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
Did you *really* enable FCM for your new project?
Yes this project is almost a clone of another one, change cosmetic, package name and JSON file

Note that you shouldn't send them with the console
For a test is useful, and for the two other project that work for testing purpose :)

Do you send to a device or a topic?
If I send to ALL topic, nothing append, if I send to a device, I got then error: The sender ID does not match the registration token. Check the sender ID used in the getToken query.

The JSON is fresly donwloaded and Package Name is OK, if not that not compile
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
I never use a Sender ID (neither in my sending apps nor in my php server). A device token looks like

B4X:
c4qDPptGpY8:APA91bGiK6FrhnCuC96bTDnkbPvfAZRKxlxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Does yours (exactly: from the device) look similar?

When I enter a invalid token (just copied a valid token and changed the last 4 chars) I the message "Invalid token" in the Firebase Console. Where does your message "The sender ID does not match the registration token. Check the sender ID used in the getToken query." come from? I only have seen "not registered" or the one from the screenshot...

It must be something simple


Unbenannt.JPG
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
Does yours (exactly: from the device) look similar?
Yes, I do a copy / paste to be sure

It must be something simple
Yes I sure it simple but I can't point it :(, this my third project the Firebase , two other work well (Android and Iphone) but this one it a nightmare, check everything 5 time, delete Firebase project/create again.... I can't see where I forgot something :confused:

error.png


It in french but that mean: The sender ID does not match the registration token. Check the sender ID used in the getToken query.

If I change a caracter in the Token I got the same error of you
 
Upvote 0

gerardguerin

Member
Licensed User
Longtime User
I never got problem with that before, but the NEW file it not documented and generate like a ghost :), this the reason I don't look them before, when I need to change resources, I change the flag Read Only, modify the file and it change itself (the flag readonly) at compile.
 
Upvote 0
Top