CameraRoll is a react-native native module that provides access to the local camera roll or photo library.
Go to file
Bartol Karuza 4e65aeea53 capitalize CameraRollPackage 2019-02-24 12:31:38 +08:00
android capitalize CameraRollPackage 2019-02-24 12:31:38 +08:00
example create-react-native-library and react-native init of example app 2019-02-24 12:13:49 +08:00
ios in file renames 2019-02-24 12:29:24 +08:00
.gitignore create-react-native-library and react-native init of example app 2019-02-24 12:13:49 +08:00
CameraRoll.js Use `invariant` instead of `fbjs/lib/invariant` 2018-12-03 00:07:02 -08:00
README.md create-react-native-library and react-native init of example app 2019-02-24 12:13:49 +08:00
index.js create-react-native-library and react-native init of example app 2019-02-24 12:13:49 +08:00
package.json create-react-native-library and react-native init of example app 2019-02-24 12:13:49 +08:00
yarn.lock create-react-native-library and react-native init of example app 2019-02-24 12:13:49 +08:00

README.md

react-native-cameraroll

Getting started

$ npm install react-native-cameraroll --save

Mostly automatic installation

$ react-native link react-native-cameraroll

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-cameraroll and add RNCCameraroll.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNCCameraroll.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactnativecommunity.cameraroll.RNCCamerarollPackage; to the imports at the top of the file
  • Add new RNCCamerarollPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-cameraroll'
    project(':react-native-cameraroll').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-cameraroll/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-cameraroll')
    

Usage

import RNCCameraroll from 'react-native-cameraroll';

// TODO: What to do with the module?
RNCCameraroll;