firebase - 如何仅在 reactnative 中使用特定用户将图像上传到 firebase?
问题描述
我正在构建一个应用程序作为我的家庭作业,但遇到了一个问题,我不明白如何添加特定用户的图像,然后在登录后显示?
解决方案
您可以使用 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]"
这里提到
推荐阅读
- react-native - 从关闭的应用程序中的通知导航时返回无法正常工作
- javascript - 使用 index.html 路由 React App 组件的问题
- typescript - 如何防止使用 TypeScript 推断泛型类型参数?
- tensorflow.js - Tensorflow.js 数据集到张量?
- python - 如何移动在 Python 中使用不同函数创建的海龟?
- javascript - 按数组属性的长度对 JavaScript 对象进行排序
- c++ - 刚开始编写 C++
- java - 使参数可选使用
类型? - ruby - Jekyll 和 Nokogiri 安装问题
- python - 将列表移动到 csv 的更好方法?