mirror of
https://github.com/status-im/react-native-camera.git
synced 2025-02-24 17:58:20 +00:00
Merge branch 'master' into patch-1
This commit is contained in:
commit
3f76bf8b35
21
CHANGELOG.md
21
CHANGELOG.md
@ -1,3 +1,24 @@
|
||||
#### 1.1.3-5 (2018-05-18)
|
||||
|
||||
##### New Features
|
||||
|
||||
* **types:**
|
||||
* add types for [#1547](https://github.com/react-native-community/react-native-camera/pull/1547) ([#1548](https://github.com/react-native-community/react-native-camera/pull/1548)) ([3ce3c80d](https://github.com/react-native-community/react-native-camera/commit/3ce3c80db670cc05dead7636d70dc8fc911a2c6b))
|
||||
* add types for [#1523](https://github.com/react-native-community/react-native-camera/pull/1523) ([f61004de](https://github.com/react-native-community/react-native-camera/commit/f61004de623a2011e99a6a8092048b513025f5ed))
|
||||
* add types for [#1518](https://github.com/react-native-community/react-native-camera/pull/1518) (FaCC) ([842dc1cb](https://github.com/react-native-community/react-native-camera/commit/842dc1cb581bd28653549dee86f70c2ff5d65ee2))
|
||||
* **rn-camera:** use and export constants ([c8c6fdea](https://github.com/react-native-community/react-native-camera/commit/c8c6fdea0bf15de60c638f504f38dcb9ac80a3e4))
|
||||
* **rn_camera:** add function as children ([45cc8f25](https://github.com/react-native-community/react-native-camera/commit/45cc8f25d2de71b9eee29e1fe14e2f4f3d2feee9))
|
||||
|
||||
##### Bug Fixes
|
||||
|
||||
* **rn-camera:** inject correct status ([858cc4c9](https://github.com/react-native-community/react-native-camera/commit/858cc4c9c8fd456390b274ee4cfddb62fee198ee))
|
||||
* **cache:** store video recordings in same directory as photos ([bba84a98](https://github.com/react-native-community/react-native-camera/commit/bba84a983446c25f76aa77793f49d4252cd63ea3))
|
||||
* **rn_camera:** improve naming ([3811d82c](https://github.com/react-native-community/react-native-camera/commit/3811d82c75ceedc27b8aa5550e352159d5daf2b8))
|
||||
|
||||
##### Other Changes
|
||||
|
||||
* Fix java.lang.ArrayIndexOutOfBoundsException with image rotation ([6ce014d3](https://github.com/react-native-community/react-native-camera/commit/6ce014d3ca3805f908fbdcd30da9b982de3bc2da))
|
||||
|
||||
#### 1.1.2-4 (2018-04-25)
|
||||
|
||||
##### Chores
|
||||
|
24
README.md
24
README.md
@ -115,7 +115,8 @@ And add something like this to the `scripts` section in your `package.json`:
|
||||
##### Installing GMV frameworks
|
||||
GMV (Google Mobile Vision) is used for Face detection by the iOS RNCamera. You have to link the google frameworks to your project to successfully compile the RNCamera project.
|
||||
|
||||
1. If using **CocoaPods** modify the dependency towards `react-native-camera` in your
|
||||
###### CocoaPods Path
|
||||
1. Modify the dependency towards `react-native-camera` in your
|
||||
`Podfile`, from
|
||||
|
||||
```
|
||||
@ -128,8 +129,17 @@ to
|
||||
pod 'react-native-camera', subspecs: ['RCT', 'RN', 'FaceDetector'], path: '../node_modules/react-native-camera'
|
||||
```
|
||||
|
||||
2. Add the following to your `Podfile`:
|
||||
```
|
||||
pod 'GoogleMobileVision/Detector', '~> 1.1.0'
|
||||
pod 'GoogleMobileVision/MVDataOutput', '~> 1.1.0'
|
||||
pod 'GoogleMobileVision/FaceDetector', '~> 1.1.0'
|
||||
```
|
||||
|
||||
2. Download:
|
||||
3. In XCode, On your target -> Build Phases -> Link Binary with Libraries -> add AddressBook.framework
|
||||
|
||||
###### Non-CocoaPods Path
|
||||
1. Download:
|
||||
Google Symbol Utilities: https://www.gstatic.com/cpdc/dbffca986f6337f8-GoogleSymbolUtilities-1.1.1.tar.gz
|
||||
|
||||
Google Utilities: https://dl.google.com/dl/cpdc/978f81964b50a7c0/GoogleUtilities-1.3.2.tar.gz
|
||||
@ -140,13 +150,13 @@ Google Symbol Utilities: https://www.gstatic.com/cpdc/dbffca986f6337f8-GoogleSym
|
||||
|
||||
Google Interchange Utilities: https://dl.google.com/dl/cpdc/1a7f7ba905b2c029/GoogleInterchangeUtilities-1.2.2.tar.gz
|
||||
|
||||
3. Extract everything to one folder. Delete "BarcodeDetector" and "copy" folders from Google Mobile Vision.
|
||||
2. Extract everything to one folder. Delete "BarcodeDetector" and "copy" folders from Google Mobile Vision.
|
||||
|
||||
4. Open XCode, right click on your project and choose "New Group". Rename the new folder to "Frameworks". Right click on "Frameworks" and select "add files to 'YOUR_PROJECT'". Select all content from the folder of step 2, click on Options. Select "Copy items if needed", leave "Create groups" selected and choose all your targets on the "Add to targets" section. Then, click on "Add".
|
||||
3. Open XCode, right click on your project and choose "New Group". Rename the new folder to "Frameworks". Right click on "Frameworks" and select "add files to 'YOUR_PROJECT'". Select all content from the folder of step 2, click on Options. Select "Copy items if needed", leave "Create groups" selected and choose all your targets on the "Add to targets" section. Then, click on "Add".
|
||||
|
||||
5. On your target -> Build Phases -> Link Binary with Libraries -> add AddressBook.framework
|
||||
6. On your target -> Build Settings -> Other Linker Flags -> add -lz, -ObjC and -lc++
|
||||
7. To force indexing and prevent errors, restart xcode and reopen your project again before compiling.
|
||||
4. On your target -> Build Phases -> Link Binary with Libraries -> add AddressBook.framework
|
||||
5. On your target -> Build Settings -> Other Linker Flags -> add -lz, -ObjC and -lc++
|
||||
6. To force indexing and prevent errors, restart xcode and reopen your project again before compiling.
|
||||
|
||||
#### Android
|
||||
1. `npm install react-native-camera --save`
|
||||
|
@ -190,18 +190,11 @@ public class CameraModule extends ReactContextBaseJavaModule {
|
||||
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
|
||||
RNCameraView cameraView = (RNCameraView) nativeViewHierarchyManager.resolveView(viewTag);
|
||||
try {
|
||||
if (!Build.FINGERPRINT.contains("generic")) {
|
||||
if (cameraView.isCameraOpened()) {
|
||||
cameraView.takePicture(options, promise, cacheDirectory);
|
||||
} else {
|
||||
promise.reject("E_CAMERA_UNAVAILABLE", "Camera is not running");
|
||||
}
|
||||
} else {
|
||||
Bitmap image = RNCameraViewHelper.generateSimulatorPhoto(cameraView.getWidth(), cameraView.getHeight());
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
image.compress(Bitmap.CompressFormat.JPEG, 100, stream);
|
||||
new ResolveTakenPictureAsyncTask(stream.toByteArray(), promise, options, cacheDirectory).execute();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
promise.reject("E_CAMERA_BAD_VIEWTAG", "takePictureAsync: Expected a Camera component");
|
||||
}
|
||||
|
@ -442,10 +442,8 @@ public class RNCameraView extends CameraView implements LifecycleEventListener,
|
||||
if ((mIsPaused && !isCameraOpened()) || mIsNew) {
|
||||
mIsPaused = false;
|
||||
mIsNew = false;
|
||||
if (!Build.FINGERPRINT.contains("generic")) {
|
||||
start();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
RNCameraViewHelper.emitMountErrorEvent(this, "Camera permissions not granted - component could not be rendered.");
|
||||
}
|
||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-camera",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"ansi-escapes": {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "react-native-camera",
|
||||
"description": "A Camera component for React Native. Also reads barcodes.",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"author": "Lochlan Wansbrough <lochie@live.com> (http://lwansbrough.com)",
|
||||
"collective": {
|
||||
"type": "opencollective",
|
||||
|
Loading…
x
Reference in New Issue
Block a user