Package Exports
- tipsi-camera-roll
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tipsi-camera-roll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tipsi-camera-roll
Getting started
$ npm install tipsi-camera-roll --save
Mostly automatic installation
$ react-native link tipsi-camera-roll
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜tipsi-camera-rolland addRNTipsiCameraroll.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNTipsiCameraroll.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
Android (Under development)
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.tipsi.cameraroll.RNTipsiCamerarollPackage;to the imports at the top of the file - Add
new RNTipsiCamerarollPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':tipsi-camera-roll' project(':tipsi-camera-roll').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-tipsi-cameraroll/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-tipsi-cameraroll')
Usage
import CameraRoll from 'tipsi-camera-roll';
CameraRoll.saveToCameraRoll('https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png', 'google')
.then(r => {
console.log('Saved', r)
})
.catch((error) => {
console.log('Saved error:', error)
})saveToCameraRoll
| Params | Desc | Type | |
|---|---|---|---|
| imageSource | Source to image. Can be url, local file path, base64 string | String | requred |
| albumName | Album name. If it nil image will be saved into Camera roll | String | optional |
TODO:
- Add Android implementation
- Add Error convector in native module
- Clean up code