Firebase数据库auth变量不起作用

时间:2016-05-24 14:31:00

标签: android firebase firebase-realtime-database firebase-authentication

Doc说

Once a user authenticates, the auth variable in your Firebase Database Rules rules will be populated with the user's information. This information includes their unique identifier (uid) as well as linked account data, such as a Facebook id or an email address, and other info.

我在google的应用程序中制作了Auth,但在尝试阅读数据库时,它返回

Firebase Database error: Permission denied

这是我的规则:

{
  "rules": {
    "msgs":{
    ".read": "auth != null && auth.provider == 'google'",
    ".write":"auth != null && auth.provider == 'google'"
    }
  }
}

1 个答案:

答案 0 :(得分:2)

尝试auth!== null似乎希望有两个等号。