Firebase Cloud Messaging Cannot Parse Topic Name

Firebase Cloud Messaging Cannot parse topic name

The / character is not an allowed character for a topic name.

Characters allowed are:

  • a-z
  • A-Z
  • 0-9
  • -, _, ., ~, %

I can confirm these are the only allowed characters by testing in Android with a topic name of pets/123asd and the logs shown:

Invalid topic name: Pets/123asd does not match the allowed format [a-zA-Z0-9-_.~%]{1,900}

For iOS, the prefix /topics/ is needed and is still valid. The invalid characters only apply to the topic name you include after the prefix.

Node JS google cloud messaging topic with prefix got Error: Malformed topic name

Looks to me that the comment in the first line of sample code on page https://firebase.google.com/docs/cloud-messaging/admin/send-messages is incorrect. Under "Defining the Message" there is clearly stated that

The topic name must not include the /topics/ prefix.

FCM Invalid topic name on base64 topic

The problem was a newline character"\n".

topic.replace("\n", "");

Firebase Cloud Messaging : not receiving message in android 12

For the new people who may come to this issue, I had the exact same issue :

In my case, I was still using Firebase library 17.x with the old deprecated architecture.

As now I updated into the firebase dependency into version 23.0.4, it worked just fine.

Ionic Firebase ios unable to subscribe to topic

Presumable it seems that these are warnings, i tried it building using the "Legacy Build System" and the firebase notifications work just fine.

Do cloud messaging topic subscriptions persist?

firebaser here

Yes. Topic subscriptions are stored on Google's servers, so persist when the app is not active. In fact, that is key in allowing the use of topics to deliver push messages when the app isn' running.

There is no need to maintain topics yourself, nor to check if they exist. If you want to send a message to a topic, you can just do so. If you want to subscribe to/unsubscribe from a topic, you can also just do that.

There is no public API that allows you to determine what tokens are subscribed to a topic, nor to determine what topics a token is subscribed to. If you need this, you'll have to maintain the necessary mappings yourself.



Related Topics



Leave a reply



Submit