gpt4 book ai didi

android - 如何允许用户在 Firebase for Android 中创建私有(private)数据?

转载 作者:太空狗 更新时间:2023-10-29 16:31:26 25 4
gpt4 key购买 nike

我想使用 Firebase 为 Android 制作一个在线密码保护程序。 Firebase 的文档告诉我身份验证和 CRUD 方法,但我找不到任何关于允许用户创建只能由他们访问的私有(private)数据的信息。我怎样才能做到这一点?或者我在哪里可以找到这些信息?

最佳答案

Firebase 数据库具有灵活的基于规则的安全模型。查看documentation了解所有详情。

当您将它与 Firebase 身份验证结合使用时,您将能够执行 user based authentication .

该文档中最简单的示例:

{
"rules": {
"users": {
"$uid": {
// grants write access to the owner of this user account
// whose uid must exactly match the key ($uid)
".write": "$uid === auth.uid"
}
}
}
}

但我建议阅读该文档以了解全部详细信息。

关于android - 如何允许用户在 Firebase for Android 中创建私有(private)数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37449711/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com