A Camera component for React Native. Also supports barcode scanning!
Go to file
Lochlan Wansbrough 505c63131b Removed extra line 2015-03-31 18:04:18 -07:00
RCTCamera.xcodeproj Pushing files 2015-03-31 18:02:57 -07:00
.gitignore Added Xcode project user data to gitignore 2015-03-31 18:03:22 -07:00
Camera.ios.js Pushing files 2015-03-31 18:02:57 -07:00
LICENSE Initial commit 2015-03-31 17:54:41 -07:00
RCTCamera.h Pushing files 2015-03-31 18:02:57 -07:00
RCTCamera.m Pushing files 2015-03-31 18:02:57 -07:00
RCTCameraManager.h Pushing files 2015-03-31 18:02:57 -07:00
RCTCameraManager.m Pushing files 2015-03-31 18:02:57 -07:00
README.md Removed extra line 2015-03-31 18:04:18 -07:00
ViewfinderView.h Pushing files 2015-03-31 18:02:57 -07:00
ViewfinderView.m Pushing files 2015-03-31 18:02:57 -07:00
package.json Pushing files 2015-03-31 18:02:57 -07:00

README.md

react-native-camera

A camera viewport for React Native. This module is currently in the very early stages of development and does not support image capture at this time, though it is coming.

Getting started

  1. Fetch from NPM: npm install react-native-camera --save
  2. In XCode, right click Libraries and Add Files to ______
  3. Add libRCTCamera.a to Build Phases -> Link Binary With Libraries

Usage

All you need is to require the react-native-camera module and then use the <Camera/> tag.

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
} = React;
var Camera = require('react-native-camera');

var cameraApp = React.createClass({
  render: function() {
    return (
      <View>
        <Camera style={{height: 200, width: 200}}/>
      </View>
    );
  }
});

AppRegistry.registerComponent('cameraApp', () => cameraApp);

Thanks to Brent Vatne (@brentvatne) for the react-native-video module which provided me with a great example of how to set up this module.