Firebase] 你的实时数据库“***[project name]”有不安全的规则

Firebase] Your Realtime Database '***[project name]' has insecure rules

我正在为我的 android 应用程序使用 firebase 实时数据库,我已经在实时数据库中编写了安全规则,但它仍然向我显示此警告。

这是我的安全规则。

{
  "rules": {
   ".read": "auth.uid !=null",
    ".write":"auth.uid !=null"
   //This is my rules in firebase Real-time database 
  }
}

here is that warning pop up to me

We've detected the following issue(s) with your security rules: any logged-in user can read your entire database any logged-in user can write to your entire database

您的安全规则是正确的,但正如文档所述和警告:

While we don't recommend leaving your data accessible to any user that's signed in, it might be useful to set access to any authenticated user while you're developing your app.

他们还不够,因为如果有人想要你的数据,他们可以登录并全部拿走,这当然是一个很大的安全问题。
因此更具体地说明您希望用户阅读的内容,例如让他们只阅读自己的数据或共享数据。
但是最终它取决于您存储的数据,如果您希望所有用户都能阅读它们(它们不是秘密)那么请不要再考虑这个警告。