Installations
npm install @react-native-community/image-picker-ios
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
12.3.1
NPM Version
6.9.0
Score
37.4
Supply Chain
52.5
Quality
75.4
Maintenance
50
Vulnerability
94.1
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (47.64%)
Objective-C (40.2%)
JavaScript (10.24%)
Ruby (1.91%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
react-native-community
Download Statistics
Total Downloads
17,101
Last Day
8
Last Week
41
Last Month
180
Last Year
997
GitHub Statistics
13 Stars
11 Commits
2 Forks
7 Watching
6 Branches
2 Contributors
Bundle Size
1.48 kB
Minified
761.00 B
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
17,101
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
Dev Dependencies
26
@react-native-community/image-picker-ios
React Native ImagePicker for iOS. It allows you to get information on:
- Can you use the Camera
- Can you record video
Getting started
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):
Manually link the library on iOS
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'
Migrating from the core react-native
module
This 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.
Usage
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});
API
- Types:
- Methods:
Types
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 |
Methods
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});
Troubleshooting
Errors while running Jest tests
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};
Issues with the iOS simulator
As your simulator doesn't have a camera, there is no way to open the camera on the simulator.
Maintainers
Contributing
Please see the contributing guide.
License
The library is released under the MIT license. For more information see LICENSE
.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
Found 3/4 approved changesets -- score normalized to 7
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Reason
105 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-4cpg-3vgw-4877
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx
- Warn: Project is vulnerable to: GHSA-7f53-fmmv-mfjv
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-gff7-g5r8-mg8m
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v
- Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx
- Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p
- Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv
- Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q
- Warn: Project is vulnerable to: GHSA-crh6-fp67-6883
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
- Warn: Project is vulnerable to: GHSA-2mj8-pj3j-h362
- Warn: Project is vulnerable to: GHSA-gqf6-75v8-vr26
- Warn: Project is vulnerable to: GHSA-v45m-2wcp-gg98
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-3gx7-xhv7-5mx3
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-ch52-vgq2-943f
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-px4h-xg32-q955
- Warn: Project is vulnerable to: GHSA-m6cx-g6qm-p2cx
- Warn: Project is vulnerable to: GHSA-x8qc-rrcw-4r46
- Warn: Project is vulnerable to: GHSA-4328-8hgf-7wjr
- Warn: Project is vulnerable to: GHSA-93f3-23rq-pjfp
- Warn: Project is vulnerable to: GHSA-jmqm-f2gx-4fjv
- Warn: Project is vulnerable to: GHSA-pw54-mh39-w3hc
- Warn: Project is vulnerable to: GHSA-xgh6-85xh-479p
- Warn: Project is vulnerable to: GHSA-6fw4-hr69-g3rv
- Warn: Project is vulnerable to: GHSA-r2j6-p67h-q639
- Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx
- Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch
- Warn: Project is vulnerable to: GHSA-3f95-r44v-8mrg
- Warn: Project is vulnerable to: GHSA-28xr-mwxg-3qc8
- Warn: Project is vulnerable to: GHSA-9p95-fxvg-qgq2
- Warn: Project is vulnerable to: GHSA-9w5j-4mwv-2wj8
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
Score
2.7
/10
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