Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-fast-camera

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-fast-camera

High-quality and fast camera component for react native

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

React Native Fast Camera

The most needed high-quality native camera for react native. A fast native camera controllable by react native components.

Full Example

Motivation

I was looking for a flexible and fast camera component for react native, tried react-native-camera and react-native-camera-kit but was not satisfied with the performance. In a nutshell, this module is the product of months of research and experimentations with an aim to create a useful solution.

Getting Started

1. Installation

  • with yarn: yarn add react-native-fast-camera
  • with npm: npm install --save react-native-fast-camera

2. Linking

    1. Copy ios/FastCamera folder to your ios folder.
    1. from Xcode Project navigator select Add Files to "project name" then select ios/FastCamera.

3. Permissions

Add the following permission strings to your info.plist file, update the messages according to your needs. Otherwise your app will crash.

<key>NSCameraUsageDescription</key>
<string>We need to access your camera to take pictures.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need to access your photo library to save the captured pictures.</string>

Usage

  import FastCamera, { Methods } from 'react-native-fast-camera';
  <FastCamera style={{ height: cameraHeight, width: cameraWidth }}
    onSaveSuccess={imageUrl => {
      console.log("onSaveSuccess: ", imageUrl);
    }}
    onGalleryImage={imageUrl => {
      console.log("onGalleryImage: ", imageUrl);
    }}
    onFlashToggle={isflashOn => {
      console.log('flash info: ', isflashOn);
    }}
  >
    {/* here render your buttons to control the camera component */}
  </FastCamera>

API

PropertyTypeDescription
onSaveSuccessCallbacka callback triggered when the image was captured and saved successfully
onGalleryImageCallbacka callback triggered when the image was selected from the user photo library
onFlashToggleCallbacka callback triggered when the flash status change
timerMethodMethods.timer() a method to show timer UI
toggleFlashMethodMethods.toggleFlash() a method to toggle flash mode
takePictureMethodMethods.takePicture() a method to capture a picture
pickImageMethodMethods.pickImage() a method to pick an image from the photo library
flipCameraMethodMethods.flipCamera() a method to flip the camera face (front/back)

TODO

  • Take a picture.
  • Pick an image from photo library.
  • Flip camera.
  • Flash On/Off mode.
  • Add timer.
  • Add Android support.
  • Add prop to set camera default face (front/back).
  • Export the iOS component as a pod module.

ACKNOWLEDGEMENTS

Keywords

FAQs

Package last updated on 09 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc