Gathering detailed insights and metrics for @react-native-community/image-picker-ios
Gathering detailed insights and metrics for @react-native-community/image-picker-ios
npm install @react-native-community/image-picker-ios
Typescript
Module System
Node Version
NPM Version
37.4
Supply Chain
52.5
Quality
75.4
Maintenance
50
Vulnerability
94.1
License
TypeScript (47.64%)
Objective-C (40.2%)
JavaScript (10.24%)
Ruby (1.91%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
17,101
Last Day
8
Last Week
41
Last Month
180
Last Year
997
13 Stars
11 Commits
2 Forks
7 Watching
6 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
@react-native-community/image-picker-ios@1.0.1
Unpacked Size
77.82 kB
Size
25.23 kB
File Count
38
NPM Version
6.9.0
Node Version
12.3.1
Cumulative downloads
Total Downloads
Last day
100%
8
Compared to previous day
Last week
10.8%
41
Compared to previous week
Last month
109.3%
180
Compared to previous month
Last year
50.6%
997
Compared to previous year
1
26
@react-native-community/image-picker-ios
React Native ImagePicker for iOS. It allows you to get information on:
Install the library using either Yarn:
yarn add @react-native-community/image-picker-ios
or npm:
npm install --save @react-native-community/image-picker-ios
You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:
react-native link @react-native-community/image-picker-ios
If you can't or don't want to use the CLI tool, you can also manually link the library using the instructions below (click on the arrow to show them):
Either follow the instructions in the React Native documentation to manually link the framework or link using Cocoapods by adding this to your Podfile
:
1pod 'react-native-image-picker-ios', :path => '../node_modules/@react-native-community/image-picker-ios'
react-native
moduleThis module was created when the ImagePickerIOS was split out from the core of React Native. To migrate to this module you need to follow the installation instructions above and then change you imports from:
1import { ImagePickerIOS } from "react-native";
to:
1import ImagePickerIOS from "@react-native-community/image-picker-ios";
Note that the API was updated after it was extracted from ImagePickerIOS to support some new features, however, the previous API is still available and works with no updates to your code.
Import the library:
1import ImagePickerIOS from "@react-native-community/image-picker-ios";
Can you use the camera:
1ImagePickerIOS.canUseCamera(canUseCamera => { 2 console.log("canUseCamera", canUseCamera); 3});
Can you record videos:
1ImagePickerIOS.canRecordVideos(canRecordVideos => { 2 console.log("canRecordVideos", canRecordVideos); 3});
OpenCameraDialogOptions
Describes the settings for the camera:
Property | Type | Description |
---|---|---|
videoMode | boolean | Should the camera open in video mode. |
OpenSelectDialogOptions
Describes the settings for the camera:
Property | Type | Description |
---|---|---|
showImages | boolean | Should the results include images |
showVideos | boolean | Should the results include videos |
canUseCamera()
Executes a callback with the a boolean value stating whether or not you can use the camera.
Example:
1ImagePickerIOS.canUseCamera(canUseCamera => { 2 console.log("canUseCamera", canUseCamera); 3});
canRecordVideos()
Executes a callback with the a boolean value stating whether or not you can record videos.
Example:
1ImagePickerIOS.canRecordVideos(canRecordVideos => { 2 console.log("canRecordVideos", canRecordVideos); 3});
openCameraDialog()
Opens the camera dialog with the specified OpenCameraDialogOptions
and two callbacks, one for success and one for cancel.
Example:
1ImagePickerIOS.openCameraDialog({ 2 unmirrorFrontFacingCamera: false 3 videoMode: false 4}, () => { 5 // success 6}, (error) => { 7 // cancel 8});
openSelectDialog()
Opens the camera dialog with the specified OpenSelectDialogOptions
and two callbacks, one for success and one for cancel.
Example:
1ImagePickerIOS.openCameraDialog({ 2 showImages: true, 3 showVideos: false 4}, (imageUrl, height, width) => { 5 // success 6}, (error) => { 7 // cancel 8});
If you do not have a Jest Setup file configured, you should add the following to your Jest settings and create the jest.setup.js
file in project root:
1setupFiles: ['<rootDir>/jest.setup.js']
You should then add the following to your Jest setup file to mock the ImagePickerIOS Native Module:
1import { NativeModules } from 'react-native'; 2 3NativeModules.RNCImagePickerIOS = { 4 canRecordVideos: jest.fn(), 5 canUseCamera: jest.fn(), 6 openCameraDialog: jest.fn(), 7 openSelectDialog: jest.fn(), 8};
As your simulator doesn't have a camera, there is no way to open the camera on the simulator.
Please see the contributing guide.
The library is released under the MIT license. For more information see LICENSE
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/4 approved changesets -- score normalized to 7
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
105 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More