title: Upload image taken with camera to firebase storage on React Native
body: <p>All I want to do is upload a photo taken using react-native-camera to firebase storage with react-native-fetch-blob, but no matter what I do it doesn't happen.</p>
  
  <p>I've gone through all of the documentations I can find and nothing seems to work.</p>
  
  <p>If anyone has a working system for accomplishing this please post it as an answer. I can get the uri of the jpg that react-native-camera returns (it displays in the ImageView and everything), but my upload function seems to stop working when it's time to put the blob.</p>
  
  <p>My current function:</p>
  
  <pre><code>uploadImage = (uri, imageName, mime = 'image/jpg') =&gt; {
      return new Promise((resolve, reject) =&gt; {
        const uploadUri = Platform.OS === 'ios' ? uri.replace('file://', '') : uri
          let uploadBlob = null
          const imageRef = firebase.storage().ref('selfies').child(imageName)
          console.log("uploadUri",uploadUri)
          fs.readFile(uploadUri, 'base64').then((data) =&gt; {
            console.log("MADE DATA")
            var blobEvent = new Blob(data, 'image/jpg;base64')
            var blob = null
            blobEvent.onCreated(genBlob =&gt; {
              console.log("CREATED BLOB EVENT")
              blob = genBlob
              firebase.storage().ref('selfies').child(imageName).put(blob).then(function(snapshot) {
                console.log('Uploaded a blob or file!');
                firebase.database().ref("selfies/" + firebase.auth().currentUser.uid).set(0)
                var updates = {};
                updates["/users/" + firebase.auth().currentUser.uid + "/signup/"] = 1;
                firebase.database().ref().update(updates);
              });
            }, (error) =&gt; {
              console.log('Upload Error: ' + error)
              alert(error)
            }, () =&gt; {
              console.log('Completed upload: ' + uploadTask.snapshot.downloadURL)
            })
          })
        }).catch((error) =&gt; {
            alert(error)
        })
    }
  </code></pre>
  
  <p>I want to be as efficient as possible, so if it's faster and takes less memory to not change it to base64, then I prefer that. Right now I just have no clue how to make this work.</p>
  
  <p>This has been a huge source of stress in my life and I hope someone has this figured out.</p>