【发布时间】:2018-06-18 14:24:39
【问题描述】:
我正在使用firebase进行身份验证(登录和注销),但是firebase.auth().createUserWithEmailAndPassword()的方法只能传递两个参数,我还想将username和用户profilePic传递给firebase并存储在它,所以登录时,可以显示相应的profilePic和用户名。我在网上搜索了很多,并对下面的代码进行了一些更改,但它根本不起作用。
如何将数据传递到 firebase 并从 firebase 中检索?
还有一个问题,就是每次注册新用户成功后,都想跳转到下一页上传图片,但是没有,直接跳转到RootPage。
即使我像(this.props.navigation.push('PhotoPage'))这样在网上添加,每次我完成注册后都会先转到<PhotoPage/>,但它只显示一秒钟,然后自动跳转到<Root/>。
我认为firebase.auth().onAuthStateChanged的方法是在后台运行的,所以每次我成功创建新用户时,firebase.auth().onAuthStateChanged的方法会检测到该用户不为空,然后返回<Root/>。怎么关掉?
【问题讨论】:
标签: reactjs firebase react-native firebase-authentication