React Native camera component for CompanyCam
Published versions: companycam-camera
See https://github.com/CompanyCam/companycam-camera/releases
Type: string
. Full path (e.g. "/var/mobile/Containers/Data/Application/[UUID]/Documents") that the component should use when writing photos.
Type: string
. For displaying only.
Type: string
. For displaying only.
Type: number
. Latitude to be written to EXIF data.
Type: number
. Longitude to be written to EXIF data.
Type: number
. Unix timestamp (in seconds) for location, to be written to EXIF data.
Type: (errmsg: string, button: string) => void
. Close the camera (i.e., stop rendering the component). The button
argument indicates why the close request was made:
button === 'error'
: An error occurred; description is given byerrmsg
button === 'label'
: The address label was pressedbutton === 'close'
: The close button was pressedbutton === 'capture'
: A photo was taken, and needs to be confirmed/edited
Type: (file: string, dims: [w: int, h: int], photoOrigin: string) => void
. Invoked when a photo is taken and should be displayed to the user for reviewing or editing. Valid photoOrigin values are:
undefined
ornull
: No origin information; treat as'STANDARD_CAMERA'
'STANDARD_CAMERA'
: Taken as normal photo without fastcam'STANDARD_CAMERA_FASTCAM'
: Taken as normal photo with fastcam'STANDARD_CAMERA_DOCSCAN'
: Taken with document scanner
Type: (file: string, dims: [w: int, h: int], photoOrigin: string) => void
. Invoked when a photo is taken and should be immediately uploaded. Valid photoOrigin values are the same as for onPhotoTaken
.
Type: string
. Caption for the 'auxiliary' button at the bottom (e.g. 'AFTER CAM').
Type: () => void
. Invoked when the 'auxiliary' button at the bottom is pressed (e.g. launch after cam).
Type: bool
. Determine whether the native UI should be hidden (default is false
).
Download the v3.2.0 iOS pack
from https://opencv.org/releases.html and put opencv2.framework
into node_modules/companycam-camera/ios
.
Add NDK via Android SDK manager. Install OpenCV Android SDK. In android/app/CMakeLists.txt
, make sure the line SET(OpenCV_DIR [...]/OpenCV-android-sdk/sdk/native/jni)
is pointing to the correct path (we should figure out a way to avoid this step).
The scanner's functionality is in the repo companycam-docscan
. At the moment, the correct workflow to modify the scanner is to clone that repo, modify the files there, and copy the files in lib/src
to both the Android and iOS native folders of companycam-camera
. In other words, don't modify the docscan files in companycam-camera
, because they are duplicated for Android and iOS and will get out of sync that way.