android - 来自 Firebase 中数据库的警告消息

标签 android firebase firebase-realtime-database firebase-security

我收到了来自 Firebase 的以下消息。我该怎么办?

You chose to start developing in Test Mode, which leaves your Realtime Database instance completely open to the Internet. Because this choice makes your app vulnerable to attackers, your database security rules were configured to stop allowing requests after the first 30 days. In 5 day(s), all client requests to your Realtime Database instance will be denied. Before that time, please update your security rules to allow your app to function while appropriately protecting your data. Analysis is run daily; if you've modified your rules in the last 24 hours those changes may not be accounted for.

这是我在 Firebase 数据库中找到的内容

{
  "rules": {

    ".read": "now < 1602709200000",  // 2020-10-15

    ".write": "now < 1602709200000",  // 2020-10-15
  }
}

最佳答案

在实时数据库规则中设置此条件:

{
  "rules": {
    "users": {
      "$uid": {
        ".read": "auth != null && auth.uid == $uid",
        ".write": "auth != null && auth.uid == $uid",
      }
    }
  }
}

关于android - 来自 Firebase 中数据库的警告消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64280489/

相关文章:

java - RecyclerView 之上的透明 TextView

ios - 重置密码时将用户重定向到 iOS 应用程序

firebase - 迁移到 Play Install Referrer API Unity3d

尝试保存到数据库时,Angularfire firestore 始终提供不足的权限

java - 在屏幕处于 sleep 状态时运行命令 firebase

javascript - Firebase update() 不是带有查询的函数

java - 在一项 Activity 中显示 TextView 的圆圈和内容

java - 最后选择的选项将转到微调器选项的顶部

java - Akka 转换为 dalvik 失败

javascript - Firebase 实时数据库 - "Error: Client is offline"。 react /NextJS