react-native-synced-cam v0.8.12
react-native-synced-cam
Getting started
$ npm install react-native-synced-cam --save
$ npm install react-native-camera@2.9.0 --save
$ npm install react-native-vector-icons --save
$ npm install react-native-video --save
$ npm install @react-native-community/cameraroll@1.2.1 --save
$ npm install react-native-permissions@1.2.0 --save
$ npm install react-native-community/async-storage --save
$ npm install react-native-safe-area-context --save
Mostly automatic installation
$ react-native link react-native-camera
$ react-native link react-native-vector-icons
$ react-native link react-native-video
$ react-native link @react-native-community/cameraroll
$ react-native link react-native-permissions
$ react-native link @react-native-community/async-storage
$ react-native link react-native-safe-area-context
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-synced-cam
and addRNSyncedCam.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNSyncedCam.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Add $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) to project's Library Search Paths
- Add empty Swift and bridging header file to project.
- Run project (
Cmd+R
)
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.reactlibrary.RNSyncedCamPackage;
to the imports at the top of the file - Add
new RNSyncedCamPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-synced-cam' project(':react-native-synced-cam').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-synced-cam/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-synced-cam')
- Add the following to android/app/build.gradle
android {
...
defaultConfig {
...
missingDimensionStrategy 'react-native-camera', 'general' <-- insert this line
}
}
Add the following to AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Usage
import RNSyncedCam from 'react-native-synced-cam';
// TODO:
<RNSyncedCam
cropDimension={'1:1'/'4:3'}
finalURI={(uri) => console.log("this is ",uri)}
onRequestClose={() => closeCamera()}
videoOnly={true/false}
pictureOnly={true/false}
renderPicker={true/false}
camRatio={'4:3'/'1:1'} //android only
forceCrop={true/false} //ios only
permissionAlert={} //Alert component for users who deny permission
headerImage={} //Image component that goes on top of permissions page
camPerm={} //Component to request camera permission
galleryPerm={} //Component to request gallery permission
micPerm={} //Component to request microphone permission
/>;
Updating Library
Login to npm
Update version number in package.json
Run npm publish
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago