Commit Graph

1392 Commits

Author SHA1 Message Date
Simon Stern
61697900c4
Merge pull request #2668 from orifmilod/docs/api
Enhance documentation: added missing properties in props index and added more explanation for api, fixed anchor redirecting to the explanation bug
2020-01-10 18:46:56 -05:00
milad440550
be66463c20 Enhance documentation: added missing properties in props index and added more explanation for api, fixed anchor redirecting to the explanation bug 2020-01-10 11:22:11 +01:00
simistern
2cde2e76a6 Docs: Added several properties and collected the methods into an index 2019-12-25 16:00:52 -05:00
dependabot[bot]
44661fc5d3 chore(deps): bump npm from 6.4.1 to 6.13.4 (#2643)
Bumps [npm](https://github.com/npm/cli) from 6.4.1 to 6.13.4.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/latest/CHANGELOG.md)
- [Commits](https://github.com/npm/cli/compare/v6.4.1...v6.13.4)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-13 15:07:23 -03:00
semantic-release-bot
c235435b4f chore(release): 3.15.0 [skip ci]
# [3.15.0](https://github.com/react-native-community/react-native-camera/compare/v3.14.0...v3.15.0) (2019-12-13)

### Features

* **ios:** Make camera ready events to fire also on camera/device change to be consistent with Android. Fire unmount error when session or device fails to start. Update advanced example app to use camera ready event instead. ([#2642](https://github.com/react-native-community/react-native-camera/issues/2642)) ([7abf3f7](https://github.com/react-native-community/react-native-camera/commit/7abf3f7))
2019-12-13 17:55:53 +00:00
cristianoccazinsp
7abf3f78cb feat(ios): Make camera ready events to fire also on camera/device change to be consistent with Android. Fire unmount error when session or device fails to start. Update advanced example app to use camera ready event instead. (#2642) 2019-12-13 14:51:50 -03:00
semantic-release-bot
0745fb90f0 chore(release): 3.14.0 [skip ci]
# [3.14.0](https://github.com/react-native-community/react-native-camera/compare/v3.13.1...v3.14.0) (2019-12-10)

### Bug Fixes

* **android:** Fix Objects.equals that is only available after API 19 ([#2635](https://github.com/react-native-community/react-native-camera/issues/2635)) ([8c6a26f](https://github.com/react-native-community/react-native-camera/commit/8c6a26f))
* **example:** fixes and updates in mlkit example ([#2618](https://github.com/react-native-community/react-native-camera/issues/2618)) ([72c5624](https://github.com/react-native-community/react-native-camera/commit/72c5624))
* **ts:** fixed incorrect type definition file path ([#2622](https://github.com/react-native-community/react-native-camera/issues/2622)) ([047bbea](https://github.com/react-native-community/react-native-camera/commit/047bbea))

### Features

* **android:** Load Android Gradle Plugin conditionally ([#2623](https://github.com/react-native-community/react-native-camera/issues/2623)) ([d8cf6c9](https://github.com/react-native-community/react-native-camera/commit/d8cf6c9))
* **android:** restore state when useCamera2api is enabled ([#2603](https://github.com/react-native-community/react-native-camera/issues/2603)) ([1f8b863](https://github.com/react-native-community/react-native-camera/commit/1f8b863))
* **docs:** update onBarCodeRead on Android and add additional SubView library ([#2616](https://github.com/react-native-community/react-native-camera/issues/2616)) ([fe84811](https://github.com/react-native-community/react-native-camera/commit/fe84811))
* **iOS:** allow for audio session to be kept ([#2636](https://github.com/react-native-community/react-native-camera/issues/2636)) ([fe5d11d](https://github.com/react-native-community/react-native-camera/commit/fe5d11d))
2019-12-10 14:07:04 +00:00
cristianoccazinsp
fe5d11d12f feat(iOS): allow for audio session to be kept (#2636)
* allow for audio session to be kept even after unmounts

* readme typo
2019-12-10 11:02:45 -03:00
cristianoccazinsp
8c6a26f289 fix(android): Fix Objects.equals that is only available after API 19 (#2635) 2019-12-10 11:02:16 -03:00
SaeedZhiany
047bbeab56 fix(ts): fixed incorrect type definition file path (#2622) 2019-12-03 16:10:26 -03:00
SaeedZhiany
d8cf6c9c10 feat(android): Load Android Gradle Plugin conditionally (#2623) 2019-12-03 16:09:23 -03:00
Märt Lõhmus
1f8b863947 feat(android): restore state when useCamera2api is enabled (#2603) 2019-12-02 09:28:13 -03:00
Chau Tran
fe8481158f feat(docs): update onBarCodeRead on Android and add additional SubView library (#2616) 2019-12-02 09:27:17 -03:00
Stanimir
72c5624dd3 fix(example): fixes and updates in mlkit example (#2618) 2019-12-02 09:24:12 -03:00
semantic-release-bot
0af8ea9756 chore(release): 3.13.1 [skip ci]
## [3.13.1](https://github.com/react-native-community/react-native-camera/compare/v3.13.0...v3.13.1) (2019-12-01)

### Bug Fixes

* **android:** barcode option passing to mlkit for Android ([#2614](https://github.com/react-native-community/react-native-camera/issues/2614)) ([32355f4](https://github.com/react-native-community/react-native-camera/commit/32355f4))
2019-12-01 23:56:03 +00:00
Kyle Johnson
32355f4779 fix(android): barcode option passing to mlkit for Android (#2614)
* pass barcode options to mlkit

* rm doubled FORMAT_ALL_FORMATS
2019-12-01 20:50:57 -03:00
semantic-release-bot
c728529563 chore(release): 3.13.0 [skip ci]
# [3.13.0](https://github.com/react-native-community/react-native-camera/compare/v3.12.0...v3.13.0) (2019-11-29)

### Features

* **types:** Add "URL" to Barcode types & export additional TS types ([#2613](https://github.com/react-native-community/react-native-camera/issues/2613)) ([3f1334c](https://github.com/react-native-community/react-native-camera/commit/3f1334c))
2019-11-29 22:04:16 +00:00
Kyle Johnson
3f1334c5e0 feat(types): Add "URL" to Barcode types & export additional TS types (#2613)
* Add "URL" to flow types

* add "URL" to barcodes & export additional TS types

* add optional format to flow

* add optionl format prop to TS
2019-11-29 19:00:10 -03:00
semantic-release-bot
ecb20719d0 chore(release): 3.12.0 [skip ci]
# [3.12.0](https://github.com/react-native-community/react-native-camera/compare/v3.11.1...v3.12.0) (2019-11-29)

### Bug Fixes

* **ios:** camera is not detecting any faces ([#2611](https://github.com/react-native-community/react-native-camera/issues/2611)) ([b3d0ebe](https://github.com/react-native-community/react-native-camera/commit/b3d0ebe))

### Features

* **docs:** Feature/simplify installtion ([#2606](https://github.com/react-native-community/react-native-camera/issues/2606)) ([a39e8a8](https://github.com/react-native-community/react-native-camera/commit/a39e8a8))
2019-11-29 21:18:30 +00:00
mieszko4
a39e8a87f8 feat(docs): Feature/simplify installtion (#2606)
* docs: split installation into 2 main sections, simplify required steps

* doc: structure Additional installation steps

* docs: Hide firebase additional android steps

* docs: Highlight code snippets, add link to Windows
2019-11-29 18:14:31 -03:00
annakoro
b3d0ebe649 fix(ios): camera is not detecting any faces (#2611) 2019-11-29 11:02:25 -03:00
Chau Tran
168b3eec8b fix onBarcodeRead (#2604) 2019-11-24 12:30:30 -03:00
mieszko4
e47ffb5e50 Add required steps for android when using rn60 (#2602) 2019-11-22 11:00:13 -03:00
semantic-release-bot
36ba510f39 chore(release): 3.11.1 [skip ci]
## [3.11.1](https://github.com/react-native-community/react-native-camera/compare/v3.11.0...v3.11.1) (2019-11-20)

### Bug Fixes

* **mlkit:** implement proper RNFaceDetectorModuleMLKit if FirebaseMLVision is una… ([#2599](https://github.com/react-native-community/react-native-camera/issues/2599)) ([e35cc2d](https://github.com/react-native-community/react-native-camera/commit/e35cc2d))
2019-11-20 10:13:46 +00:00
Moritz
e35cc2dfd3 fix(mlkit): implement proper RNFaceDetectorModuleMLKit if FirebaseMLVision is una… (#2599)
* implement proper RNFaceDetectorModuleMLKit if FirebaseMLVision is unavailable

* fix constants
2019-11-20 07:09:34 -03:00
semantic-release-bot
92525f2c69 chore(release): 3.11.0 [skip ci]
# [3.11.0](https://github.com/react-native-community/react-native-camera/compare/v3.10.0...v3.11.0) (2019-11-20)

### Features

* **exif:** Implement writeExif for iOS, Android improvements ([#2577](https://github.com/react-native-community/react-native-camera/issues/2577)) ([aa22fd1](https://github.com/react-native-community/react-native-camera/commit/aa22fd1))
2019-11-20 03:26:12 +00:00
cristianoccazinsp
aa22fd1fff feat(exif): Implement writeExif for iOS, Android improvements (#2577)
* - Improve Android code so skipProcessing is not needed, the code is more in line with iOS, and is "fast" by default. This means that skipProcessing is no longer needed (nor used), and adding additional options will "slow down" the capture as expected, rather than having always a lot of processing. This shouldn't be a breaking change.

- document the writeExif option, and implement it for iOS as well.

* Release CF object which could cause a memleak
2019-11-20 00:22:08 -03:00
semantic-release-bot
7fa631f32d chore(release): 3.10.0 [skip ci]
# [3.10.0](https://github.com/react-native-community/react-native-camera/compare/v3.9.0...v3.10.0) (2019-11-20)

### Bug Fixes

* **android:** fix possible crash when attempting to retrieve camera parameters. ([#2570](https://github.com/react-native-community/react-native-camera/issues/2570)) ([be8a08c](https://github.com/react-native-community/react-native-camera/commit/be8a08c))
* **android:** Possible ANR due to events not fired on the main thread ([#2591](https://github.com/react-native-community/react-native-camera/issues/2591)) ([ad9d084](https://github.com/react-native-community/react-native-camera/commit/ad9d084))

### Features

* **docs:** update example readme and ios splash screen text ([#2589](https://github.com/react-native-community/react-native-camera/issues/2589)) ([cd0ca06](https://github.com/react-native-community/react-native-camera/commit/cd0ca06))
* **docs:** update react-navigation doc ([#2574](https://github.com/react-native-community/react-native-camera/issues/2574)) ([81563d7](https://github.com/react-native-community/react-native-camera/commit/81563d7))
* **example:** New example app using RN 0.61, native-base, and react-navigation. ([#2588](https://github.com/react-native-community/react-native-camera/issues/2588)) ([9c6fcea](https://github.com/react-native-community/react-native-camera/commit/9c6fcea))
* **ios:** Handle audio interruption in session queue. This prevents the session isRunning flag from getting corrupted due to concurrent updates to the session. ([#2567](https://github.com/react-native-community/react-native-camera/issues/2567)) ([ffbd805](https://github.com/react-native-community/react-native-camera/commit/ffbd805))
* **ios:** Preserve exif/metadata on photo capture. ([#2573](https://github.com/react-native-community/react-native-camera/issues/2573)) ([fabacb4](https://github.com/react-native-community/react-native-camera/commit/fabacb4))
* **npm:** ignore docs and publish 3.11.0 ([7c1284f](https://github.com/react-native-community/react-native-camera/commit/7c1284f))
* **npm:** ignore website when publishing to npm, manual bump ([aa0e2a9](https://github.com/react-native-community/react-native-camera/commit/aa0e2a9))
* **ts:** Update index.d.ts ([#2590](https://github.com/react-native-community/react-native-camera/issues/2590)) ([eece04a](https://github.com/react-native-community/react-native-camera/commit/eece04a))
2019-11-20 02:44:42 +00:00
Sibelius Seraphini
7c1284f73f
feat(npm): ignore docs and publish 3.11.0 2019-11-19 23:39:46 -03:00
Sibelius Seraphini
aa0e2a9baf
feat(npm): ignore website when publishing to npm, manual bump 2019-11-19 23:33:15 -03:00
cristianoccazinsp
cd0ca062e8 feat(docs): update example readme and ios splash screen text (#2589) 2019-11-18 09:53:26 -03:00
maderesponsively
eece04a66c feat(ts): Update index.d.ts (#2590)
Added missing googleVisionBarcodeMode prop
2019-11-18 09:53:06 -03:00
cristianoccazinsp
ad9d0840fd fix(android): Possible ANR due to events not fired on the main thread (#2591)
* This is a fix for events possibly being fired not on the main thread, which could cause the whole app to freeze.

* Fire events on the right thread. No need to use UI thread, and fix the still works
2019-11-18 09:52:35 -03:00
cristianoccazinsp
9c6fcea43e feat(example): New example app using RN 0.61, native-base, and react-navigation. (#2588)
Includes a camera screen with support for the right dimensions, aspect ratio, flash, tap to focus, pinch to zoom, flash, and multi camera support.
2019-11-15 11:15:19 -03:00
cristianoccazinsp
ffbd805bcf feat(ios): Handle audio interruption in session queue. This prevents the session isRunning flag from getting corrupted due to concurrent updates to the session. (#2567) 2019-11-11 11:42:58 -03:00
cristianoccazinsp
be8a08ce9c fix(android): fix possible crash when attempting to retrieve camera parameters. (#2570) 2019-11-11 11:30:06 -03:00
cristianoccazinsp
fabacb4e93 feat(ios): Preserve exif/metadata on photo capture. (#2573)
* Preserve exif/metadata on photo capture. Add a few comments to each step of the capture process

* orientation must be fixed before mirroring

* x/y dimensions are redundantly updated (storing the image sets them automatically). However, orientation must be reset on any image change since the final stored image is automatically rotated when it is modified in place.

* revert mirrorImage order, has to be first since forceUpOrientation adjusts the image afterwards.

* Minor change: also implement `onPictureTaken` for iOS in case anyone needs the early event.
2019-11-11 11:29:16 -03:00
Theodore Sevvos
81563d7a0b feat(docs): update react-navigation doc (#2574) 2019-11-11 11:28:41 -03:00
Sibelius Seraphini
cc3016fe43
doc(tidelift): add security section on readme
[skip ci]
2019-11-08 16:16:54 -03:00
semantic-release-bot
4eb67c7b63 chore(release): 3.9.0 [skip ci]
# [3.9.0](https://github.com/react-native-community/react-native-camera/compare/v3.8.0...v3.9.0) (2019-11-04)

### Bug Fixes

* **ios:** Fix for a possible crash when changing devices and changing focus. If the new device resets the focus, "defocusing" might not be possible if the new device does not support auto focus. For this reason, we need to do a different cleanup on the focus and exposed flags and events. ([#2557](https://github.com/react-native-community/react-native-camera/issues/2557)) ([8f4601b](https://github.com/react-native-community/react-native-camera/commit/8f4601b))

### Features

* **android:** Android ui thread ([#2560](https://github.com/react-native-community/react-native-camera/issues/2560)) ([87774dd](https://github.com/react-native-community/react-native-camera/commit/87774dd))
* **Ios:** handle audio interruptions ([#2565](https://github.com/react-native-community/react-native-camera/issues/2565)) ([59dfdb6](https://github.com/react-native-community/react-native-camera/commit/59dfdb6))
2019-11-04 21:46:50 +00:00
cristianoccazinsp
59dfdb649a feat(Ios): handle audio interruptions (#2565)
* This update tries to improve audio recording interruptions on iOS due to phone calls or background music.

- Use a more generic event to handle session interruptions. This removes the need to listen to foreground/background events, and stopping the session this way was actually redundant/wrong (see https://forums.developer.apple.com/thread/61406). This also makes session stopping detection more reliable (calls, suspension due to a call or notification, etc., which would previously not set the recording interrupted flag on every case)

From the above docs: "No, incorrect. You _never_ need to stop your capture session. The capture session automatically stops itself when your app goes to the background and resumes itself when you come back to the foreground."

- Allow for `captureAudio` updates to also update the audio connections internally so the prop can be correctly updated on the fly without remounting.

- add onAudioInterrupted and onAudioConnected events so the UI can handle scenarios where audio is wanted but not available. This should also help in keeping the preview active even if audio is interrupted and we have captureAudio={true}. Lastly, it can be used to detect if we can record audio or not due to the dummy implementation of the audio permission on iOS always returning true.

- check, activate, and release audio sessions (if captureAudio) so we can detect early if audio is available before attempting to connect the input. This will also allow us to detect if we can record even if there was already a call before opening the camera.

- use proper observer for session error instead of of the strong self block. No benefit, but makes code more readable and allows access to instance variables

- getDeviceOrientationWithBlock might fire more than once under some circumstances, ending up taking a picture or video twice. Add a lock and additional check to prevent this.

* no need for change check,

* do not resume audio if we were hinted not to (e.g., music playback happening)

* start session here also on session queue.

* check for session running before trying to record or capture.
This should fix a possible race condition where both the session start call happens at the same time as the record call

* no need to set orientation on constructor, and set it on session queue to prevent race conditions

* move device init and checks also to session queue. This prevents possible double initializations.
2019-11-04 18:39:37 -03:00
cristianoccazinsp
8f4601b3b0 fix(ios): Fix for a possible crash when changing devices and changing focus. If the new device resets the focus, "defocusing" might not be possible if the new device does not support auto focus. For this reason, we need to do a different cleanup on the focus and exposed flags and events. (#2557) 2019-11-04 17:42:28 -03:00
cristianoccazinsp
87774dd370 feat(android): Android ui thread (#2560)
* Move heavy work to a dedicated background thread. Improves camera initial loading and resumes from background.

Details:

- Use a HandlerThread to delegate heavy tasks to background. The thread is managed by the view, and passed down to the implementation in case it also needs to use it. The view will fire start calls and other possibly heavy operations in this thread to avoid ANRs. Some code sent to this thread:
    - start calls: start is extremely heavy and will cause ANRs on some devices, especially when coming back from background
    - Camera1: some preset changes fire a stop/start sequence. These will now happen in the background thread
    - take picture and start recording (from view class) will also start in this thread

- Add some extra null checks

- View was not properly cleaning up itself on destroy (host destroy event was never fired)

* catch possible errors when starting camera preview. This might still randomly fail on some devices for some reason.

* delay capture in progress until we have resumed/paused preview.

* do not crash the app if set texture setup failed

* more synchronized checks to prevent crashes due to concurrent camera updates

* remove unused imports
2019-11-04 14:53:42 -03:00
semantic-release-bot
0158ebfd39 chore(release): 3.8.0 [skip ci]
# [3.8.0](https://github.com/react-native-community/react-native-camera/compare/v3.7.2...v3.8.0) (2019-10-19)

### Bug Fixes

* **ios:** Honor captureAudio flag by not requesting audio input if set to false. ([#2542](https://github.com/react-native-community/react-native-camera/issues/2542)) ([db8ce26](https://github.com/react-native-community/react-native-camera/commit/db8ce26))

### Features

* **android:** support null object of androidPermissionOptions to avoid request window ([#2551](https://github.com/react-native-community/react-native-camera/issues/2551)) ([20e0486](https://github.com/react-native-community/react-native-camera/commit/20e0486))
* **ci:** CircleCI Fix & Optimizations ([#2550](https://github.com/react-native-community/react-native-camera/issues/2550)) ([4705834](https://github.com/react-native-community/react-native-camera/commit/4705834))
* **readme:** improve tidelift ([28e8ad5](https://github.com/react-native-community/react-native-camera/commit/28e8ad5))
* **torch:** Torch fixes for iOS and a few nil checks. ([#2543](https://github.com/react-native-community/react-native-camera/issues/2543)) ([7abc7c2](https://github.com/react-native-community/react-native-camera/commit/7abc7c2))
2019-10-19 02:12:02 +00:00
Sibelius Seraphini
255e19e77a
doc(tidelift): add tidelift for enterprise 2019-10-18 23:07:24 -03:00
Symous
20e04863c7 feat(android): support null object of androidPermissionOptions to avoid request window (#2551) 2019-10-18 08:44:38 -03:00
Michael Thanh
4705834f08 feat(ci): CircleCI Fix & Optimizations (#2550)
* fix(docs-ci): restore builds and add gradle caching

* fix(ci-docs): comment config out to test key changes

* fix(docs-ci): fix gradle caching keys

* fix(docs-ci): fixed another typo in gradle cache key

* fix(docs-ci): separate yarn and gradle steps for app

* fix(docs-ci): experiment w/ jvm RAM and remove 2nd yarn

* fix(docs-ci): add yarn install statement back in

* fix(docs-ci): move gradle cache restore earlier

* fix(docs-ci): add deploy steps and job back in [skip ci]

* fix(docs-ci): change gradle cache keys to use multiple files

* fix(docs-ci): add artifacting to job

* fix(deploy-ci): add deploy steps and job back in [skip ci]
2019-10-18 08:42:21 -03:00
Sibelius Seraphini
28e8ad5734
feat(readme): improve tidelift 2019-10-16 18:12:11 -03:00
cristianoccazinsp
7abc7c2e01 feat(torch): Torch fixes for iOS and a few nil checks. (#2543)
* Torch fixes for iOS and a few nil checks.

- Torch turned on by default should work as expected (turned on after mounting and camera type switch)
- Torch maintained when video recording starts (it will flicked if preset has to change)
- Torch resumed when app comes back from background (it is disabled on session pause)

* Fix Torch mode while recording for Android as well.
2019-10-16 18:09:07 -03:00
cristianoccazinsp
db8ce264bf fix(ios): Honor captureAudio flag by not requesting audio input if set to false. (#2542)
Further improve video stopping after the slight delay was added so the stop operation works even if video didn't start yet.
2019-10-16 06:50:59 -03:00