首页 > 解决方案 > 如何仅在 reactnative 中使用特定用户将图像上传到 firebase?

问题描述

我正在构建一个应用程序作为我的家庭作业,但遇到了一个问题,我不明白如何添加特定用户的图像,然后在登录后显示?

标签: firebasereact-nativeauthenticationreact-redux

解决方案


您可以使用 Google Cloud Storage 从移动设备或后端上传您的图片。

为此,您需要注册Google Cloud Console

如果你想直接从设备上传,你可以像这样使用 REST API:

curl -X POST --data-binary @[OBJECT_LOCATION] \
-H "Authorization: Bearer [OAUTH2_TOKEN]" \
-H "Content-Type: [OBJECT_CONTENT_TYPE]" \
"https://www.googleapis.com.com/upload/storage/v1/b/[BUCKET_NAME]/o?uploadType=media&name=[OBJECT_NAME]"

这里提到


推荐阅读