0.0.8 • Published 6 years ago
@wellth/wellth-react-native-camera v0.0.8
wellth-react-native-camera
Features
- Support iOS 9.3, Android level 16
- Allows for auto-captured stream of photos.
- Allows for multiple output formats for a single capture (including auto captured images!).
Installation
$ (yarn | npm) add @wellth/wellth-react-native-camera
$ react-native link
iOS
- In your main project (that is, the one requiring
wellth-react-native-camera
) create a new.swift
file in the same directory as yourAppDelegate.h
. - Xcode will prompt you to create a bridging header. Create the header.
- Build and run
Android
Coming Soon
Usage
Taken from example/App.js
:
import * as React from 'react'
import Camera from "wellth-react-native-camera"
import type { OutputConfiguration } from "wellth-react-native-camera"
type Props = {
style: ViewProps,
shouldCapture: boolean,
}
export default (props: Props) => {
return (
<Camera
style={props.style}
readyForCapture={props.shouldCapture}
outputConfigurations={[
{
name: "fullSize",
size: 1,
quality: 1,
},
{
name: "thumbnail",
size: 0.4,
quality: 1,
},
]}
onCaptureOutput={output => {
const { thumbnail, fullSize } = output;
console.log(thumbnail.imagePath);
console.log(fullSize.imagePath);
}}
/>
);
};
Development
Setup
iOS
1. Install dev dependencies:$ yarn install
Open the
.xcworkspace
inios/
Build
React
at least once.Build
Camera
.
Android