我试图将所有用户的个人资料照片存储在实时数据库中,但遇到了问题。
当尝试使用此代码上传 PhotoUrl 时,会出现此错误。
代码:
var user = firebase.auth().currentUser;
user.updateProfile({
// Here, "name" and "imgUrl" are parameters of parent function.
// I don't think this is the reason, but if it helps,
// "imgUrl" always come from a <img> src.
displayName: name,
photoUrl: imgUrl
}).then(function(){
// Here is where I try to upload all to the database
firebase.database().ref("/Usuarios/" + user.uid).set({
"email": email,
"name": name,
"photoUri": user.photoUrl, // This is where I think the problem originates.
"uid": user.uid // This calls …Run Code Online (Sandbox Code Playgroud)