【发布时间】:2017-07-14 19:09:03
【问题描述】:
我正在尝试在 firebase 上更新/添加数据。我使用了 Facebook 登录,我想使用 UserID 作为新数据的键。
(查看下图)
我想使用的用户ID:
我想用用户 ID 替换那个键:
fblogin(){
this.facebook.login(['email'])
.then(res=> {
const fc = firebase.auth.FacebookAuthProvider.credential(res.authResponse.accessToken);
firebase.auth().signInWithCredential(fc)
.then(fs => {
this.facebook.api('me?fields=id,name,email,first_name,picture.width(720).height(720).as(picture_large)', []).then(profile => {
this.newuser = {name: profile['first_name'] ,email: profile['email'],picture: profile['picture_large']['data']['url'],phone:''}
this.navCtrl.push(HomePage);
console.log(fs.uid);
this.db.list('/users/'+ fs.uid).update(this.newuser);
});
我在编译时遇到了这个错误:
提供的参数与调用目标的任何签名都不匹配
在这一行:this.db.list('/users/'+ fs.uid).update(this.newuser);
有什么帮助吗?
【问题讨论】:
标签: javascript firebase ionic-framework firebase-realtime-database ionic3