title: How do I upload an image taken React-Native-camera to Firebase storage?
body: <p>I want upload image taken with react-native-camera to <a href="https://github.com/invertase/react-native-firebase" rel="nofollow noreferrer">https://github.com/invertase/react-native-firebase</a> storage on RN</p>
  
  <p>I can't upload image.</p>
  
  <p>I tried image-picker-library and did work.</p>
  
  <pre><code>import React, { Component } from 'react';
  import {Image, View, Text, StyleSheet, Dimensions,TouchableOpacity} from 'react-native'
  import { RNCamera } from 'react-native-camera';
  import {strings} from '../Lang/Strings';
  import { Actions } from 'react-native-router-flux';
  const { width, height } = Dimensions.get('window');
  
  
  export default class ScanPage extends Component {
  constructor(props) {
          super(props);
          this.state = {
  
    takePicture = async () =&gt; {
      if (this.camera) {
  
        const options = { quality: 0.5, base64: true }
        const data = await this.camera.takePictureAsync(options)
  
  
        Actions.ProfilePage({imagePath:data.uri,
          selectedIndex:this.state.selectedIndex,
          shapes:this.state.shapes });
          this.uploadPhoto(data);
  
  };
  
    };
  
    render() {
      const {selectedIndex, images, shapes} = this.state;
        return(
            &lt;View style={styles.container}&gt;
            &lt;RNCamera
              ref={ref =&gt; {
                this.camera = ref;
              }}
              style={styles.preview}
              type={RNCamera.Constants.Type.front}
              permissionDialogTitle={'Permission to use camera'}
              permissionDialogMessage={'We need your permission to use your camera phone'}  /&gt;
            &lt;View style={{flex:1,justifyContent:'center' ,alignItems:'center'}}&gt;
            &lt;View style={{marginTop:120}}&gt;
        &lt;Image   source={images[selectedIndex]} &gt;
        &lt;/Image&gt;
        &lt;/View&gt;
        &lt;/View&gt;
            &lt;View style={styles.buttonSection}&gt;
            &lt;TouchableOpacity onPress={this._TogglePrev}&gt;
              &lt;View style={styles.buttons}&gt;
              &lt;Text style={{textAlign:'center',color: 'white'}}&gt;
              {strings.back} 
              &lt;/Text&gt;
  
              &lt;/View&gt;
              &lt;/TouchableOpacity&gt;
  
              &lt;View style={{alignItems:'center', justifyContent:'center',
           height:height*0.04}}&gt; 
  
              &lt;Text style ={{color:'white',textAlign:'center'}}&gt;{shapes[selectedIndex]} &lt;/Text&gt; 
  
              &lt;/View&gt;
              &lt;TouchableOpacity onPress={this._ToggleNext}&gt;
              &lt;View style={styles.buttons}&gt;
              &lt;Text style={{textAlign:'center', color: 'white'}}&gt;
              {strings.next} 
              &lt;/Text&gt;
  
              &lt;/View&gt;
              &lt;/TouchableOpacity&gt;
            &lt;/View&gt; 
  
            &lt;View style={{alignItems:'center', justifyContent:'center',
            backgroundColor:'#D9E6FF',height:height*0.001,width:width*1}}&gt; 
  
              &lt;Text style ={{color:'white',textAlign:'center'}}&gt; &lt;/Text&gt; 
  
              &lt;/View&gt;
            &lt;View style={{ flex: 0, flexDirection: 'row', justifyContent: 'center'}}&gt;
  
              &lt;TouchableOpacity onPress={this.takePicture.bind(this)} style={styles.capture}
              &gt;
              &lt;View style={{ 
        backgroundColor: 'white',
        borderRadius: (height*0.16)/2,
        padding: 15,
        alignSelf: 'center',
        margin: 25,
       height:height*0.085,
       width:width*0.16,
        justifyContent:'center',
        alignItems:'center',
        borderWidth:0.9,
        borderColor:'#D9E6FF',}}&gt;&lt;/View&gt;
              &lt;/TouchableOpacity&gt;
            &lt;/View&gt;
  
          &lt;/View&gt;
        );
      }
  
      takePicture = async function() {
        if (this.camera) {
  
          const options = { quality: 0.5, base64: true };
          const data = await this.camera.takePictureAsync(options);
  
          Actions.ProfilePage({imagePath:data.uri,
            selectedIndex:this.state.selectedIndex,
            shapes:this.state.shapes 
      });
        }
      };
    }
  </code></pre>
  
  <p>I didn't upload firebase, 
  versions 
  react: 16.4.1, 
  react-native: 0.56.0,
  react-native-camera:1.12.0,
  react-native-firebase:5.2.3
  react-native-router-flux:4.0.1</p>