title: Share image plus text via Whatsapp with React Native
body: <p>I am working on a react native app and one of my needs is to be able to share via Whatsapp, a png image (created from a svg) plus some text in the message. I have achieved this on Android using <a href="https://github.com/react-native-community/react-native-share" rel="nofollow noreferrer">react-native-share</a> but when I try it on iOS, the message is populated with the provided text but the image is ignored. I have also tried with <a href="https://facebook.github.io/react-native/docs/share" rel="nofollow noreferrer">Share</a> from react-native but the result is the same.</p>
  
  <p>I have tried this sharing directly a base64 image <strong>(data:image/png;base64,<em>image_data</em>)</strong> as well as saving the created image and add the <strong>path as the url</strong> but the result is always the same.</p>
  
  <p>The only way to make this work on iOS (with both react-native-share and Share) is to omit the message, but the text is needed in the requirement.</p>
  
  <p>Is there a way to achieve this?</p>
  
  <p>Versions:</p>
  
  <ul>
  <li>React Native - 0.55.0</li>
  <li>react-native-share - 1.1.2</li>
  </ul>
  
  <blockquote>
    <p>As a side note, the sharing process on Twitter, Email, SMS and some other apps is working correctly.</p>
  </blockquote>
  
  <p>Code sample:</p>
  
  <pre><code>const base64Data = this.state.uri
  const dir = `${RNFS.DocumentDirectoryPath}/tmp_${moment().valueOf()}.png`
  
  RNFS.writeFile(dir, base64Data, 'base64').then(async () =&gt; {
    const options = {
      url: Platform.OS === 'android' ? `file://${dir}` : dir,
      message: '' // By omitting the message, whatsapp shows the image
    }
    try {
      await Share.open(options)
      // Delete file when share action is completed
      await RNFS.unlink(dir)
    } catch (error) {
      console.log('error', error)
    }
  }).catch((err) =&gt; {
    console.log(err.message)
  })
  </code></pre>