2

I am not able to share image on twitter using react-share. My code is :

<TwitterShareButton 
     url={window.location.href} 
     title={props.data.breadcrumb}
     imageURL={props.data.product_info.image_path}
     children={<TwitterIcon size={32} round={true} />}
/>

image is being loaded from api. i have changed imageURL to media and it is still not working. Can i share image or not?

Linda Paiste
  • 38,446
  • 6
  • 64
  • 102
rajatgalav
  • 329
  • 1
  • 6
  • 19

1 Answers1

-1

Seems like you could share this as a base64 url from this response https://github.com/react-native-community/react-native-share/issues/119 which is pretty cool and easy.

So basically set the url prop:

url: "data:image/png;base64,<base64_data>"
Karim
  • 415
  • 6
  • 14