Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-image-picker

> 前端框架
Open source

:sunrise_over_mountains: A React Native module that allows you to use native UI to select media from the device library or directly from the camera.

8.6K stars0 likes3 views
WebsiteGitHub

About

:sunrise_over_mountains: A React Native module that allows you to use native UI to select media from the device library or directly from the camera.

react-native-image-picker

A React Native module that allows you to select a photo/video from the device library or camera.

Installation

bash
yarn add react-native-image-picker

New Architecture

To take advantage of the new architecture run-

iOS

bash
RCT_NEW_ARCH_ENABLED=1 npx pod-install ios

Android

Set newArchEnabled to true inside android/gradle.properties

Pre-Fabric (AKA not using the new architecture)

bash
npx pod-install ios

Post-install Steps

iOS

Add the appropriate keys to your Info.plist depending on your requirement:

Requirement Key
Select image/video from photos NSPhotoLibraryUsageDescription
Capture Image NSCameraUsageDescription
Capture Video NSCameraUsageDescription & NSMicrophoneUsageDescription

Android

No permissions required (saveToPhotos requires permission check).

Note: This library does not require Manifest.permission.CAMERA, if your app declares as using this permission in manifest then you have to obtain the permission before using launchCamera.

Targeting Android API Levels Below 30

If your app's minSdkVersion is set to below 30 and it does not already include or depend on androidx.activity:activity:1.9.+ or a newer version, you'll need to add the following line to the dependencies section of your app/build.gradle file to ensure support for the backported AndroidX Photo Picker:

groovy
dependencies {
    ...
    implementation("androidx.activity:activity:1.9.+")
    ...
}

Additionally, you may need to update your AndroidManifest.xml to trigger the installation of the backported Photo Picker. For reference, you can check the example app's configuration in example/android/app/src/main/AndroidManifest.xml and example/android/app/build.gradle.

For more details, consult the Android documentation on AndroidX Photo Picker: https://developer.android.com/training/data-storage/shared/photopicker

API Reference

Methods

javascript
import {launchCamera, launchImageLibrary} from 'react-native-image-picker';

launchCamera()

Launch camera to take photo or video.

javascript
launchCamera(options?, callback);

// You can also use as a promise without 'callback':
const result = await launchCamera(options?);

See Options for further information on options.

The callback will be called with a response object, refer to The Response Object.

launchImageLibrary

Launch gallery to pick image or video.

javascript
launchImageLibrary(options?, callback)

// You can also use as a promise without 'callback':
const result = await launchImageLibrary(options?);

See Options for further information on options.

The callback will be called with a response object, refer to The Response Object.

Options

Option iOS Android Web Description
mediaType OK OK OK photo or video or mixed(launchCamera on Android does not support 'mixed'). Web only supports 'photo' for now.
restrictMimeTypes NO OK NO Array containing the mime-types allowed to be picked. Default is empty (everything).
maxWidth OK OK NO To resize the image.
maxHeight OK OK NO To resize the image.
videoQuality OK OK NO low, medium, or high on iOS, low or high on Android.
durationLimit OK OK NO Video max duration (in seconds).
quality OK OK NO 0 to 1, photos.
conversionQuality NO OK NO For conversion from HEIC/HEIF to JPEG, 0 to 1. Default is 0.92
cameraType OK OK NO 'back' or 'front' (May not be supported in few android devices).
includeBase64 OK OK OK If true, creates base64 string of the image (Avoid using on large image files due to performance).
includeExtra OK OK NO If true, will include extra data which requires library permissions to be requested (i.e. exif data).
saveToPhotos OK OK NO (Boolean) Only for launchCamera, saves the image/video file captured to public photo.
selectionLimit OK OK OK Supports providing any integer value. Use 0 to allow any number of files on iOS version >= 14 & Android version >= 13. Default is 1.
presentationStyle OK NO NO Controls how the picker is presented. currentContext, pageSheet, fullScreen, formSheet, popover, overFullScreen, overCurrentContext. Default is currentContext.
formatAsMp4 OK NO NO Converts the selected video to MP4 (iOS Only).
assetRepresentationMode OK OK NO A mode that determines which representation to use if an asset contains more than one on iOS or disables HEIC/HEIF to JPEG conversion on Android if set to 'current'. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'.
androidCameraPackage NO OK NO The package name of the camera app to use on Android. If not provided, the default camera app will be used. Only applicable when mediaType is set to photo. Not supported for video capture. If the specified app is not installed on the device, the camera will fail to launch.

The Response Object

key iOS Android Web Description
didCancel OK OK OK true if the user cancelled the process
errorCode OK OK OK Check ErrorCode for all error codes
errorMessage OK OK OK Description of the error, use it for debug purpose only
assets OK OK OK Array of the selected media, refer to Asset Object

Asset Object

key iOS Android Web Photo/Video Requires Permissions Description
base64 OK OK OK PHOTO ONLY NO The base64 string of the image (photos only)
uri OK OK OK BOTH NO The file uri in app specific cache storage. Except when picking video from Android gallery where you will get read only content uri, to get file uri in this case copy the file to app specific storage using any react-native library. For web it uses the base64 as uri.
originalPath NO OK NO BOTH NO The original file path.

Issues· 350 open

View all issuesOpen on GitHub
  • #2382

    [] Cannot select downloaded video from external sources

    :bug: BugUpdated Sep 29, 2026
  • #2412

    Bug: Android camera crashes after image capture on newer devices (Samsung, OnePlus, Oppo, Vivo)

    :bug: BugUpdated Sep 14, 2026
  • #2125

    [] launchImageLibrary Options do not change the Video size

    :bug: BugUpdated Sep 11, 2026
  • #2323

    [] Android Orientation still Turned by 90 degrees

    :bug: BugUpdated Sep 7, 2026
  • #2358

    [] assetRepresentationMode: 'current' renames heic to jpeg without conversion.

    :bug: BugUpdated Aug 30, 2026
  • #2411

    [] [Android] maxWidth/maxHeight silently fail to resize large images (full-res decode returns original)

    :bug: BugUpdated Aug 30, 2026
  • #2409

    [Android] Bridgeless callbacks crash after pick + null-safety in mime detection and startActivityForResult

    Updated Aug 23, 2026
  • #2415

    [] Fatal SIGABRT: picker callback invoked twice (`Callback arg cannot be called more than once`) on New Architecture — iOS and Android

    :bug: BugUpdated Aug 13, 2026
  • #2414

    [Android] Fatal crash: "callback arg cannot be called more than once" — race in onAssetsObtained callback lifecycle

    Updated Aug 13, 2026
  • #2391

    [] SIGABRT ABORT 0x00000001eb21d2d4

    :bug: BugUpdated Aug 13, 2026

> Tags

Javaimage-pickerpickerreact-native

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架