I wanted a way to base64 encode videos and photos from the CameraRoll in react-native. So I came up with this solution.
- Open up your project and drag the Base64Asset.h and Base64Asset.m classes into your project.
- Run the project
- Use the module by using:
const {NativeModules} = React
NativeModules.Base64Asset.read(assetUri, (base64EncodedFile) => { console.log(base64EncodedFile) })
- That's it!