<bdo id='y4pT6'></bdo><ul id='y4pT6'></ul>
  1. <i id='y4pT6'><tr id='y4pT6'><dt id='y4pT6'><q id='y4pT6'><span id='y4pT6'><b id='y4pT6'><form id='y4pT6'><ins id='y4pT6'></ins><ul id='y4pT6'></ul><sub id='y4pT6'></sub></form><legend id='y4pT6'></legend><bdo id='y4pT6'><pre id='y4pT6'><center id='y4pT6'></center></pre></bdo></b><th id='y4pT6'></th></span></q></dt></tr></i><div id='y4pT6'><tfoot id='y4pT6'></tfoot><dl id='y4pT6'><fieldset id='y4pT6'></fieldset></dl></div>

  2. <tfoot id='y4pT6'></tfoot>

    1. <small id='y4pT6'></small><noframes id='y4pT6'>

      <legend id='y4pT6'><style id='y4pT6'><dir id='y4pT6'><q id='y4pT6'></q></dir></style></legend>
    2. Firebase 云消息传递无法解析主题名称

      时间:2023-07-30

        1. <i id='4k1hv'><tr id='4k1hv'><dt id='4k1hv'><q id='4k1hv'><span id='4k1hv'><b id='4k1hv'><form id='4k1hv'><ins id='4k1hv'></ins><ul id='4k1hv'></ul><sub id='4k1hv'></sub></form><legend id='4k1hv'></legend><bdo id='4k1hv'><pre id='4k1hv'><center id='4k1hv'></center></pre></bdo></b><th id='4k1hv'></th></span></q></dt></tr></i><div id='4k1hv'><tfoot id='4k1hv'></tfoot><dl id='4k1hv'><fieldset id='4k1hv'></fieldset></dl></div>

            <bdo id='4k1hv'></bdo><ul id='4k1hv'></ul>
          • <legend id='4k1hv'><style id='4k1hv'><dir id='4k1hv'><q id='4k1hv'></q></dir></style></legend>

              <small id='4k1hv'></small><noframes id='4k1hv'>

            • <tfoot id='4k1hv'></tfoot>
                <tbody id='4k1hv'></tbody>
                本文介绍了Firebase 云消息传递无法解析主题名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试在我的 iOS 应用中订阅一个主题,但不断收到错误消息:

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

                <FIRMessaging/WARNING> Cannot parse topic name /topics/pets/cnlLksAxmdYPkDjEftDwZjFwvDw2_coffee. Will not subscribe.
                

                我要订阅的代码是这样的:

                The code I'm trying to subscribe with is this:

                FIRMessaging.messaging().subscribe(toTopic: "/topics/pets/(name)")
                

                其中 name 是您在错误中看到的主题的最后一部分.

                where name is the last part of the topic you see in the error.

                有人知道我做错了什么吗?我已经确认 Firebase 消息可以正确接收通知.

                Does anybody know what I'm doing wrong? I've already confirmed Firebase messaging is correctly receiving notifications and all.

                推荐答案

                / 字符不是 主题名称 允许的字符.

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

                允许的字符是:

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

                我可以通过在 Android 中使用主题名称为 pets/123asd 和显示的日志进行测试来确认这些是唯一允许的字符:

                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}
                

                对于 iOS,前缀 /topics/ 是必需的,并且仍然有效.无效字符仅适用于您在前缀后包含的主题名称.

                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.

                这篇关于Firebase 云消息传递无法解析主题名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:FirebaseMessagingService 默认在后台运行吗? 下一篇:如何从 FCM 令牌中获取 Firebase 用户 ID?(在服务器上的管理代码中)

                相关文章

                    <i id='lXtAu'><tr id='lXtAu'><dt id='lXtAu'><q id='lXtAu'><span id='lXtAu'><b id='lXtAu'><form id='lXtAu'><ins id='lXtAu'></ins><ul id='lXtAu'></ul><sub id='lXtAu'></sub></form><legend id='lXtAu'></legend><bdo id='lXtAu'><pre id='lXtAu'><center id='lXtAu'></center></pre></bdo></b><th id='lXtAu'></th></span></q></dt></tr></i><div id='lXtAu'><tfoot id='lXtAu'></tfoot><dl id='lXtAu'><fieldset id='lXtAu'></fieldset></dl></div>
                    <tfoot id='lXtAu'></tfoot>

                    <small id='lXtAu'></small><noframes id='lXtAu'>

                      <bdo id='lXtAu'></bdo><ul id='lXtAu'></ul>
                    <legend id='lXtAu'><style id='lXtAu'><dir id='lXtAu'><q id='lXtAu'></q></dir></style></legend>