title: Convert static image to Base64 in ReactNative
body: <p>I have static image which i need to convert in <code>Base64</code> and then send it to Android/iOS native code.</p>
  
  <p>If i select an image from file i am able to send it to native code and convert that to <code>Base64</code>.</p>
  
  <p>But what if i have static image and then send it to native code.</p>
  
  <pre><code>&lt;Image source={require('./img/icon.png')}/&gt;
  </code></pre>
  
  <p>I want <code>icon.png</code> to be sent in Android/iOS native module.</p>
  
  <p>I have done native coding, it is something like this</p>
  
  <pre><code>@ReactMethod
  public void filterBase64(String base64, Callback stringCallback) {
  
  }
  </code></pre>
  
  <p>But stucked at how to send <code>Base64</code></p>
  
  <p>I have checked <a href="https://www.npmjs.com/package/react-native-image-to-base64" rel="nofollow noreferrer">react-native-image-to-base64</a> but not able to get solution, when i use </p>
  
  <pre><code>NativeModules.RNImageToBase64.getBase64String(uri, (err, base64) =&gt; {
      // Do something with the base64 string 
  })
  </code></pre>
  
  <p>It shows error <code>undefined is not an object</code></p>