通过身份验证从 firebase 数据库获取价值

getting value from firebase database by authentication

我的 android 应用程序有一个字符串,我想将它发送到 Firebase 数据库以获得 authentication.If 该字符串匹配 "jhgkjgl",我希望 Firebase 向我发送数据,否则不发送任何东西。

我必须在我的 java 和 firebase 控制台中写些什么? 我需要做什么?

规则:

{
"rules":{
".read":"auth.uid.matches(/jhgkjgl/)"
}
}

我想在我的应用程序中获取的数据:

q:"qqqweryty"

我的路径是:

https://fir-rial-8888.firebaseio.com/

我只想使用字符串 authentication.If 我的应用程序中的字符串与服务器的字符串相匹配,我想获取我的密钥的值 "q"。

如果你尝试像..

".read":"newData.val() == 'jhgkjgl'"