FCM 主题名称是否有任何限制? [英] Are there any limitations for the FCM topics names?

查看:27
本文介绍了FCM 主题名称是否有任何限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解 FCM 的主题名称是否有任何限制.设法找到有关主题数量的信息(没有限制),但没有主题名称的长度或允许的字符.

I'm trying to find out if there are any limitations for the topic names for FCM. Managed to find info about the number of topics (no limitations), but nothing like length of topic name or allowed characters.

推荐答案

是的,不是所有字符都可以,主题名称中不允许有空格.

Yes, not all characters are allowed, having space between words is not allowed in topic names.

来自文档:

向 Firebase 云消息传递主题发送消息与向单个设备或用户组发送消息非常相似.应用服务器将消息正文中的主题键设置为 yourTopic 之类的值.开发者可以选择任何匹配正则表达式的主题名称:[a-zA-Z0-9-_.~%]+"

sending messages to a Firebase Cloud Messaging topic is very similar to sending messages to an individual device or to a user group. The app server sets the topic key in the message body with a value like yourTopic. Developers can choose any topic name that matches the regular expression: "[a-zA-Z0-9-_.~%]+"

有关更多信息,请查看:https://firebase.google.com/docs/cloud-messaging/android/topic-messaging(构建请求部分)

for more info check this: https://firebase.google.com/docs/cloud-messaging/android/topic-messaging (build request section)

这篇关于FCM 主题名称是否有任何限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆