react-native-get-real-path
Get real file path from file uri
Installation (iOS)
Currently No Support
Installation (Android)
npm i react-native-get-real-path@https://github.com/Wraptime/react-native-get-real-path.git --save
Make alterations to the following files:
android/settings.gradle
...include ':react-native-get-real-path'project(':react-native-get-real-path').projectDir = new File(settingsDir, '../node_modules/react-native-get-real-path/android')
android/app/build.gradle
...dependencies { ... compile project(':react-native-get-real-path')}
-
register module (in MainActivity.java)
- For react-native below 0.19.0 (use
cat ./node_modules/react-native/package.json | grep version
)
- For react-native below 0.19.0 (use
// <--- import
- For react-native 0.19.0 and higher
// <------- add package
Example usage (Android only)
// require the modulevar RNGRP = ; RNGRP
Use Case - get images from CameraRoll as base64
- Required: react-native-fs https://github.com/johanneslumpe/react-native-fs
RNGRP
- For iOS you can checkout: https://github.com/scottdixon/react-native-upload-from-camera-roll/