Skip to content

Get media (photo/camera) easily without worrying about permission, without worrying if user block permission, without worrying either user pick camera or gallery. Just focus on your app, we handle media request thingy for you

License

Notifications You must be signed in to change notification settings

fattahmuhyiddeen/react-native-get-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

react-native-get-media

Get media (photo/camera) easily without worrying about permission, without worrying if user block permission. Just focus on your app, we handle media request thingy.

We handle:

  1. Asking user whether to use Camera or Gallery.
  2. Asking permission (in Javascript level, make sure you already configure react-native-permissions on native level).
  3. Asking user to open setting if user already block permission in the first place.
  4. Return object returned by react-native-image-picker.

Dependencies

This libraries requires these libraries. PLease install it by yourself:

  1. react-native-image-picker
  2. react-native-permissions
  3. react-native-actionsheet

Can install in one simple command npm i -S react-native-image-picker react-native-permissions react-native-actionsheet or yarn add react-native-image-picker react-native-permissions react-native-actionsheet.

Make sure you install and configure according to their documentations respectively.

"react-native-image-picker": "^1.1.0", "react-native-permissions": "^2.0.8", "react-native-actionsheet": "2.4.2"

Usage

//importing
import GetMedia from 'react-native-get-media';

//make sure you render the component. This is just wrapper of react-native-actionsheet. While onMedia Props return the same thing that react-native-image-picker returns. you can follow their docs.
<GetMedia
 ref={instance => (this.getMedia = instance)}
 onMedia={this.onImagePicked}
 labels={{
   cancel: 'Cancel,
   camera: 'Camera,
   gallery: 'Gallery',
 }}
/>


//to call the get media wherever in the component
this.getMedia.askGetMedia();

About

Get media (photo/camera) easily without worrying about permission, without worrying if user block permission, without worrying either user pick camera or gallery. Just focus on your app, we handle media request thingy for you

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published