Firebase数据库查询不起作用

编程入门 行业动态 更新时间:2024-10-25 15:33:02
本文介绍了Firebase数据库查询不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我试图创建一个Firebase登录和注册应用程序。我已经设置,在注册时,android id将保存到数据库。如果Android ID与另一个帐户退出,则用户无法创建帐户。当我运行的应用程序,并尝试注册一个帐户显示注册请稍候...,nothings发生。我该如何解决这个问题?为了解决这个问题,所有关于认证的问题都建议你使用 Firebase身份验证。

这很容易实现,而且您不会

要查找Android设备的序列号,请使用以下代码:

TelephonyManager tManager =(TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE); String androidSerialNumber = tManager.getDeviceId();

有了这个 androidSerialNumber ,您可以使用它保存在你的数据库中。

0下载表示接受

另一种方法是更改​​数据库规则:

{rules: {.read:true,。写:auth!= null} }

I am trying to create a Firebase Login and Register App. I have setup that At the time of registration android id will save to the database. If the Android Id exits with another account the user can't create account . when i run the app and try to register an account its shows "Registering Please Wait..." and nothings happens . How can i fix this?

解决方案

To solve this problem and all your problems regarding authentication is suggest you using Firebase Authentication.

It's very easy to implement and you'll don't have in the future any code to maintain.

To find serial number of Android device please use this code:

TelephonyManager tManager = (TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE); String androidSerialNumber = tManager.getDeviceId();

Having this androidSerialNumber you can use it to save it in your database.

0down voteaccepted

Another approach will be to change The Rule Of Database like this:

{ "rules": { ".read": "true", ".write": "auth != null" } }

更多推荐

Firebase数据库查询不起作用

本文发布于:2023-10-23 19:50:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1521843.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库查询   不起作用   Firebase

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!