Open purvotara opened 6 years ago
Same problem here in react-native version 0.60.2
Showing error:
setUpDeveloperTools.js:73 Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'getBase64String' of undefined
TypeError: Cannot read property 'getBase64String' of undefined
I used another package: react-native-fs
import RNFS from 'react-native-fs';
var data = await RNFS.readFile( "file://path-to-file", 'base64').then(res => { return res });
This works fine.
@gilshaan While that does work, it is a very heavy library to import if you simply want a base64 image.
@purvotara Have you got a reproduction step with a supplied image?
I used another package:
react-native-fs
import RNFS from 'react-native-fs';
var data = await RNFS.readFile( "file://path-to-file", 'base64').then(res => { return res });
This works fine.
How to use with https url.Its not working.
Hi,
Thanks a lot for the wonderful work. In the android, conversion is working fine(Can you please add the permission check, if the read external storage is not given), but in the IOS conversion is not at happening. It's giving data as undefined. I mean base64String is undefined in IOS.
Could you please help in solving the issue.
Regards, Sharath