Firebase Cloud Messaging Cannot parse topic name

前端 未结 1 1136
梦毁少年i
梦毁少年i 2020-12-11 04:16

I\'m trying to subscribe to a topic in my iOS app, but keep getting the error:

 Cannot parse topic name /topics/pets/cnlLksAxmdYP         


        
相关标签:
1条回答
  • 2020-12-11 04:52

    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.

    0 讨论(0)
提交回复
热议问题