Am using react-native-share to share my app content to social media. In order to add image along in it image should be converted to base64. I tried few libraries but none of them is successful. I need to show image in asset folder as preview. Hence I tried giving path as "assets/images/myimage.png". but none of library works. I tried react-native-fs, react-native-image-base64, can anyone help me in this.
Asked
Active
Viewed 1,647 times
1
-
Check this answer here [image to base64](https://stackoverflow.com/a/53256481/7684651) – Ron Astle Lobo Nov 14 '19 at 13:40
-
https://stackoverflow.com/questions/34908009/react-native-convert-image-url-to-base64-string Have a look at this. Also possible duplicate question – Asim Poptani Nov 14 '19 at 14:38
-
@AsimPoptani I had seen the same post . But am not able to give it correct path. When I tried it shows no such file exists even though it exists in my assets/images folder. – suja Nov 15 '19 at 04:08
-
@AsimPoptani do you have any idea how to give path for images in assets/iamges – suja Nov 15 '19 at 04:08
-
@Ron thanks for link but could you tell me how to point to our local images (images in assets folder I mean) – suja Nov 15 '19 at 04:10
-
@suja check out this answer [file path](https://stackoverflow.com/a/52551982/7684651) – Ron Astle Lobo Nov 15 '19 at 08:36
-
@Ron will check and let you know – suja Nov 15 '19 at 09:18