【发布时间】:2021-11-27 13:58:47
【问题描述】:
我在 react-native 和 native-cli 中使用 Firebase 身份验证模块。注册时,我正在使用 react-native-document-picker 上传图片。从图库中选择图像后,它将如下所示:
{
"fileCopyUri":"content://com.android.providers.media.documents/document/image%3A33077",
"name":"IMG-20211005-WA0007.jpg",
"size":67094,
"type":"image/jpeg",
"uri":"content://com.android.providers.media.documents/document/image%3A33077"
}
并使用此功能将其上传到 firebase:
auth().currentUser.updateProfile({
displayName:fullname,
photoURL:JSON.stringify(pic),
})
现在当我得到它时:
const fireUser = auth().currentUser;
console.log(JSON.parse(fireUser.photoURL))
它在屏幕上显示图像,但是当我退出应用程序并再次打开或登录应用程序时,它不显示图像,但我在 photoURL 中有图片。
可以转换文件吗?
{
"fileCopyUri":"content://com.android.providers.media.documents/document/image%3A33077",
"name":"IMG-20211005-WA0007.jpg",
"size":67094,
"type":"image/jpeg",
"uri":"content://com.android.providers.media.documents/document/image%3A33077"
}
进入网址?
我做错了什么?
【问题讨论】:
标签: android react-native firebase-authentication