通过身份验证从Firebase数据库获取价值 [英] getting value from firebase database by authentication

查看:149
本文介绍了通过身份验证从Firebase数据库获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的android应用程序有一个字符串,我想将它发送到Firebase数据库进行身份验证。如果该字符串匹配jhgkjgl,我希望Firebase向我发送数据,否则不会发送任何内容。

b
$ b

我必须在我的java和firebase控制台中编写这两个函数?
我需要做什么?

规则:

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

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

  q:qqqweryty 

我的路径是:

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

我只想使用字符串进行身份验证。如果我的应用程序中的字符串与服务器的字符串匹配,我想获得我的密钥q的值。

解决方案

如果你尝试类似的东西。

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


My android app has a string ,and i want to send it to the Firebase database for authentication.If that string matches "jhgkjgl",i want Firebase to send me the data ,otherwise not send anything.

What do i have to write both in my java and firebase console? What do i need to do?

rules:

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

The data i want to get in my app :

q:"qqqweryty"

My path is:

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

I just want to use the string for authentication.If the string in my app matches that of server's ,i want to get the value of my key "q".

解决方案

what if you try something like ..

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

这篇关于通过身份验证从Firebase数据库获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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