Socket
Socket
Sign inDemoInstall

image-picker-react-native

Package Overview
Dependencies
2
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    image-picker-react-native

该组件基于 https://github.com/easonline/AndroidImagePicker 封装成 react native 版本,并在实现上做了一些改动


Version published
Weekly downloads
4
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

#image-picker-react-native

该组件基于 https://github.com/easonline/AndroidImagePicker 封装成 react native 版本,并在实现上做了一些改动

Features

  • 选图后点击完成,js端获取到所选图url
  • js端可控制选图Activity finish

Installation

npm i --save image-picker-react-native

on Android:

####1. android/settings.gradle:: Add the following snippet

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

####2. android/app/build.gradle: Add in dependencies block.

compile project(':image-picker-react-native')

####3. in your MainActivity (or equivalent) the ImagePickerPackage needs to be added. Add the import at the top:

import com.leolang.imagepicker.ImagePickerPackage;

####4. In order for React Native to use the package, add it the packages inside of the class

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
	new MainReactPackage(),
	...
	new ImagePickerPackage()
  );
}

Usage

###js

import ImagePicker from 'ImagePicker';

ImagePicker.multiImagePicker(false, (errorMsg) => {
      }, (selectedUrls) => {
          ImagePicker.finishMultiImagePicker();
      });


##sample

###android/app & index.android.js

FAQs

Last updated on 15 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc