@textile/react-native-camera-roll
v1.1.6
Published
A dead simple camera-roll polling endpoint.
Downloads
11
Keywords
Readme
@textile/react-native-camera-roll
A dead simple camera-roll polling endpoint.
- Request a new check for photos since forever
import CameraRoll from '@textile/react-native-camera-roll'
const minEpoch = 0
CameraRoll.requestLocalPhotos(minEpoch)
- Listen for photos detected
import { eventEmitter as Events, ILocalPhotoResult } from '@textile/react-native-camera-roll'
Events.addListener('@textile/newLocalPhoto', (localPhoto: ILocalPhotoResult) => {
// Do something
})
Getting started
$ npm install @textile/react-native-camera-roll --save
Mostly automatic installation
$ react-native link @textile/react-native-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
➜@textile/react-native-camera-roll
and addRNCameraRoll.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNCameraRoll.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import io.textile.cameraroll.RNCameraRollPackage;
to the imports at the top of the file - Add
new RNCameraRollPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-camera-roll' project(':react-native-camera-roll').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera-roll/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-camera-roll')
Usage
import CameraRoll from '@textile/react-native-camera-roll';
// TODO: What to do with the module?
CameraRoll;