st0ffern / react-native-mediapicker

Media picker for React Native
22 stars 10 forks source link
camera media mediapicker photos picker react-native

react-native-mediapicker version npm dependencies Commitizen friendly [npm]()

Greenkeeper badge

Media Picker for React Native

Props

Installation

npm i -S react-native-mediapicker

or

yarn add react-native-mediapicker

Link Native Modules (IOS)

In XCode, you need to add a link to RCTCameraRoll. You will find more information in the react-native docs

Add Purpose String (IOS)

For IOS10 you need to add a “Privacy - Photo Library Usage Description”-key to Info.plist. For more information, see this blog

Usage Examples

import MediaPicker from "react-native-mediapicker"
<MediaPicker
  callback={items => this.whenClicked(items)}
  groupTypes="SavedPhotos"
  assetType="Photos"
  maximum={1}
  imagesPerRow={3}
  imageMargin={5}
  showLoading={true}
  backgroundColor="black"
  selectedMarker={
    <Image
      style={[styles.checkIcon, {width: 25, height: 25, right: this.props.imageMargin + 5},]}
      source={require('./checkmark.png')}
    />
  } />