无效的Firebase路径:.com。 Firebase路径不得包含'。','#','$','['或']' [英] Invalid Firebase path: .com. Firebase paths must not contain '.', '#', '$', '[', or ']'

查看:134
本文介绍了无效的Firebase路径:.com。 Firebase路径不得包含'。','#','$','['或']'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要将电子邮件和密码保存在Firebase数据库中,但不幸的是我得到了这个错误。

 无效的Firebase路径:.com。 Firebase路径不得包含'。','#','$','['或']'

解决方案

路径(键)不允许路径中的某些特殊字符。

在将电子邮件存储为路径时,我建议您对电子邮件进行编码,即将点替换为逗号。如果你想检索,你可以解码。

  public static String EncodeString(String string){
return string.replace(。,,);


public static String DecodeString(String string){
return string.replace(,,。);



$ b $ p
$ b让我知道它是怎么给你的。


I'm going to save the email and password in a Firebase database, but unfortunately I got this error.

Invalid Firebase path: .com. Firebase paths must not contain '.', '#', '$', '[', or ']'

解决方案

As could be noticed from the error, Firebase path(key) doesn't doesn't allow certain special characters in the path.
While storing email as path, I recommend you to encode the email i.e., replace 'dots' from 'commas'. If you wan't to retrieve, you can decode.

public static String EncodeString(String string) {
    return string.replace(".", ",");
}

public static String DecodeString(String string) {
    return string.replace(",", ".");
}

Let me know, how it goes for you.

这篇关于无效的Firebase路径:.com。 Firebase路径不得包含'。','#','$','['或']'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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