# react-native-image-chooser

> A react-native module for showing system image chooser.

Latest version **1.0.4** (published 2016-09-16) · 0 weekly downloads

## Install

```sh
npm install react-native-image-chooser
pnpm add react-native-image-chooser
yarn add react-native-image-chooser
bun add react-native-image-chooser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2016-09-16 |
| First published | 2015-12-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Satyajit Sahoo |
| Maintainers | satya164 |
| Keywords | android, react, react-native, image, chooser |

## Links

- npm: https://www.npmjs.com/package/react-native-image-chooser
- Repository: https://github.com/satya164/react-native-image-chooser
- Homepage: https://github.com/satya164/react-native-image-chooser#readme
- Issues: https://github.com/satya164/react-native-image-chooser/issues
- npm.io page: https://npm.io/package/react-native-image-chooser

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2016-09-16
- 1.0.3 — 2016-04-04
- 1.0.2 — 2016-03-25
- 1.0.1 — 2016-01-04
- 0.1.2 — 2015-12-10
- 0.1.1 — 2015-12-05
- 0.1.0 — 2015-12-05

## README

# `react-native-image-chooser`

A React Native module to show system Image chooser. Currently only supports Android.

### Installation

```sh
npm i --save react-native-image-chooser
```

### Add it to your android project

In `android/settings.gradle`

```gradle
...

include ':react-native-image-chooser'
project(':react-native-image-chooser').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-chooser/android')
```

In `android/app/build.gradle`

```gradle
...

dependencies {
    ...

    compile project(':react-native-image-chooser')
}
```

Register module (in `MainActivity.java`)

```java
import com.imagechooser.ImageChooserPackage;  // <--- import

public class MainActivity extends ReactActivity {

  ......

  @Override
  protected List<ReactPackage> getPackages() {
    return Arrays.asList(
      new MainReactPackage(),
      new ImageChooserPackage() // <------ add the package
    );
  }

  ......

}
```

## Usage

First import the module as follows:

```js
import ImageChooser from "react-native-image-chooser";
```

To show the chooser, call the `pickImage` method:

```js
try {
  const data = await ImageChooser.pickImage();

  // do something with the data
} catch (err) {
  // handle error
}
```

The `pickImage` method returns a `Promise` with data. The data object has the following properties:

```js
height: number;
width: number;
size: number;
name: string;
uri: string;
```

---
_Source: https://npm.io/package/react-native-image-chooser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
