A high performance, easy to use, rock solid camera library for React Native apps.
Go to file
Yedidya Kennard 3f6c978199 2.0.1 2016-08-01 15:02:20 +03:00
android Moved refreshData in GalleryAdapter to background thread 2016-08-01 15:01:50 +03:00
example crash fix - fix issue when image not supported, try to add nil to an array 2016-07-19 16:04:36 +03:00
ios/lib iOS - add checkDevicePhotosAuthorizationStatus and requestDevicePhotosAuthorization 2016-07-31 16:20:22 +03:00
src Android API matches iOS, fixed changeCamera failing to reconnect 2016-08-01 13:25:45 +03:00
.flowconfig Camera kit initial commit 2016-04-14 10:44:00 +03:00
.gitignore Camera kit initial commit 2016-04-14 10:44:00 +03:00
.npmignore add npmignore 2016-07-21 09:40:39 +03:00
.watchmanconfig Camera kit initial commit 2016-04-14 10:44:00 +03:00
LICENSE Create LICENSE 2016-04-14 14:39:54 +03:00
README.md Update README.md 2016-07-26 17:21:51 +03:00
index.android.js Android Camera component 2016-07-04 14:10:21 +03:00
index.ios.js changes for android new branch 2016-06-29 16:12:53 +03:00
package.json 2.0.1 2016-08-01 15:02:20 +03:00

README.md

react-native-camera-kit

Currently work in progress.

Native camera control.

Install

Install using npm:

npm install react-native-camera-kit --save

####IOS

  • Locate the module lib folder in your node modules: PROJECT_DIR/node_modules/react-native-camera-kit/lib
  • Drag the ReactNativeCameraKit.xcodeproj project file into your project
  • Add libReactNativeCameraKit.a to all your target Linked Frameworks and Libraries (prone to be forgotten)

####Android Add

        include ':rncamerakit'
        project(':rncamerakit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera-kit/android/')

to your project's settings.gradle

Then add

        compile project(":rncamerakit")

to your app app/build.gradle in the dependencies section.

Then in MainActivity.java add:

        import com.wix.RNCameraKit.RNCameraKitPackage;

and in getPackages add

        new RNCameraKitPackage() 

to the list

Examples

###CameraKitCamera

<CameraKitCamera
            ref={(cam) => {
                  this.camera = cam;
                }} // should be only if u want to make some actions in this specific camera instance
            style={{flex: 1, justifyContent: 'flex-end'}}
            cameraOptions={{
                    flashMode: 'auto',
                    focusMode: 'on',
                    zoomMode: 'on'
                  }}
          />

####capture Capture image

const image = await this.camera.capture(true);

####setFlashMode

Set flesh mode (auto/on/off)

const success = await this.camera.setFlashMode(newFlashData.mode);

####changeCamera

Change to fornt/rear camera

const success = await this.camera.changeCamera();

###CameraKitGalleryView

<CameraKitGalleryView
          ref={(gallery) => {
                            this.gallery = gallery;
                           }}
          style={{flex: 1, marginTop: 20}}
          minimumInteritemSpacing={10}
          minimumLineSpacing={10}
          albumName={<ALBUM_NAME>}
          columnCount={3}
          onSelected={(result) => {
              //result.nativeEvent.selected - ALL selected images Photos Framework ids
            }}
          selectedImage={require('<IMAGE_FILE_PATH>')}
          unSelectedImage={require('<IMAGE_FILE_PATH>')}
        />