【问题标题】:Write Firebase Auth User UID to database将 Firebase Auth 用户 UID 写入数据库
【发布时间】:2016-08-19 15:02:13
【问题描述】:

目前,我的应用程序使用以下内容制作用户配置文件并为我的数据库生成自动 ID:

databaseRef.child("users").childByAutoId().setValue(user)

我希望它是使用 Firebase 用户 UID 值生成的用户 UID,而不是使用 .childByAutoID,但是我不确定如何将其交换到我上面的代码中。

【问题讨论】:

    标签: swift xcode firebase firebase-realtime-database firebase-authentication


    【解决方案1】:
    databaseRef.child("users").child(FIRAuth.auth()!.currentUser!.uid).setValue(user)
    

    【讨论】:

    • 谢谢您的帮助
    猜你喜欢
    • 1970-01-01
    • 2016-11-01
    • 2017-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 2020-01-01
    • 1970-01-01
    相关资源
    最近更新 更多