title: react-native: creating image from base64 string for iOS and Android (in react-native-elements list)
body: <p>I'm trying to display icons in a dynamic (react-native-elements) list from a DB via REST call which delivers the icon as base64 encoded string (i.e. here done with jHipster/swagger).</p>
  
  <p>It has to work for both iOS and Android.</p>
  
  <p>I thought this should be a quite common use case, but it turns out somewhat challenging...</p>
  
  <p>What I tried so far:</p>
  
  <ol>
  <li>using <code>static addImageFromBase64(base64ImageData, success, failure)</code> <a href="https://facebook.github.io/react-native/docs/imagestore.html" rel="nofollow noreferrer">see here</a> 
  
  <ul>
  <li>works for iOS only (<code>@platform ios</code>)</li>
  </ul></li>
  <li>using 'data:' uri scheme like this example (as discussed <a href="https://stackoverflow.com/questions/29380265/does-react-native-support-base64-encoded-images/33448478#33448478">here</a>):</li>
  </ol>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANS ...
  &lt;Image source={{uri: base64Icon}} ... /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <ul>
  <li>the <a href="https://github.com/facebook/react-native/pull/576" rel="nofollow noreferrer">PR mentioned in that discussion</a> was closed later, but somehow it seems that 'data:' scheme still was introduced, see <a href="https://github.com/facebook/react-native/blob/master/React/Base/RCTConvert.m#L761" rel="nofollow noreferrer">RCTConvert.m</a>, although it is not documented in <a href="https://facebook.github.io/react-native/docs/image.html" rel="nofollow noreferrer">Image</a></li>
  <li>but again it seems it was implemented only for iOS (only in the .m file)</li>
  <li>Looking at <a href="https://github.com/facebook/react-native/blob/master/Libraries/Image/Image.android.js" rel="nofollow noreferrer">Image for Android</a>, it seems that rendering is delegated to the native side and this could be the reason why it was not implemented for Android (at least it does not work for me in Android).</li>
  </ul>
  
  <p>So is there any good way to get a base64 image string into an Android react-native app?</p>
  
  <p>Or is there a good practice or library to solve this (getting icons dynamically from a DB via REST API into a react-native app) in a complete different way?</p>