【发布时间】:2019-10-22 13:10:37
【问题描述】:
我试图在我的 Firebase 数据库中获取用户信息(例如:用户名),但在 .ts 文件中,我不知道如何对其进行编码
我厌倦了使用auth.uid 从数据库中获取用户名但没有用。下面是我用来保存用户配置文件的代码。效果很好。
this.afAuth.authState.pipe(take(1)).subscribe(auth => {
let path= 'userProfile'+'/'+ auth.uid;
this.afDatabase.object(path).set(this.profile);
})
但我不知道如何获取它的信息。所以在我的数据库中,在“userProfile”下有“用户名”。如何使用此逻辑获取用户名?我需要使用 auth.uid 在我的应用中显示用户名
【问题讨论】:
标签: firebase ionic-framework firebase-realtime-database firebase-authentication ionic4