react-native-firebase-upload
This package allows you to upload assets from React Native to Firebase Cloud Storage through a Firebase Cloud Function.
Installation
yarn add react-native-firebase-upload express busboy raw-body
in your functions dir.
yarn add react-native-firebase-upload
in your React Native project.
Usage
Firebase Cloud Function
const admin = ;const functions = ;const upload = ; admin; exportsupload = functionshttps; // with authenticationexportsupload = functionshttps;
React Native
;; ; const pick = async { try // we are using Expo here const cancelled uri = await ImagePicker; if !cancelled let name = uri; name = namenamelength - 1; const token = await currentUser; // true = forceRefresh const metadata = await ; console; catch err console; };