New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@paralect/native-media-picker

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paralect/native-media-picker

An instagram-like designed native media picker for ReactNative applications

  • 1.0.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
4
Weekly downloads
 
Created
Source

native-media-picker

React-native media picker for IOS and Android. Instagram like designed.

Getting started

Run in react-native project folder: $ npm i @paralect/native-media-picker

Import module in your javascript file

import NativeMediaPicker from '@paralect/native-media-picker';

Usage

Pick image for avatar

const config = {
  imageSideCap : 512,
  showRoundAim : true 
}

NativeMediaPicker.showMediaPicker(config)
  .then( result => { 
    console.log(result.items) 
    console.log(result.isCancelled) 
  } )
  .catch( error => { Alert.alert(error.message) } );

Pick multiple images and save picker state.

const config = {
  imageSideCap : 1024,    	
  maxItems : 5,
  saveState: true
}

NativeMediaPicker.showMediaPicker(config)
  .then( result => { console.log(result) } )
  .catch( error => { Alert.alert(error.message) } );

Show picker with saved state

NativeMediaPicker.showStoredMediaPicker()
  .then( (result) => { console.log(result) } )
  .catch( error => { Alert.alert(error.message) } );

Reset saved picker

NativeMediaPicker.resetPicker()

Configuration variables

VariableDescriptionTypeDefault value
imageSideCapMaximum value of the side of the image. Oversized image will be resized proportionallyInteger1024
maxItemsCount of images to pick. Multiple pick enabled if 1+Integer1
showRoundAimAdd round presetBooleanfalse
saveStateSave state of picker after dismissingBooleanfalse
showFiltersEnable option to choose filters for imageBooleanfalse

Result dictionary

keyDescriptionType
itemsBase64 encoded imagesArray
isCancelledFlag tell picking cancelledBoolean

Setup

  • Setup iOS
  • Setup Android

Cropping rules

Maximim aspect ratio:

  • for landscape images - 1.5
  • for portrait images - 1.2

Release new version

To release new npm package you need to:

  1. Update package version in package.json
  2. Run following script ./bin/new-release.sh "v1.0.1" "Publish empty release" (specify changes list and version)
  3. Wait for Drone to publish npm package.

Keywords

FAQs

Package last updated on 02 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc