npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-image-selector

v1.2.0

Published

image picker native module

Downloads

39

Readme

react-native-image-selector

This module is alternative version of https://github.com/react-native-image-picker/react-native-image-picker

The only change could be iOS (for iOS 14 limited selection issues).

So I created Image Viewer View Controller which only shows selected images (if user selected limited permission) only for iOS.

Installation

npm

$ npm install react-native-image-selector

yarn

$ yarn add react-native-image-selector

lerna

$ lerna add react-native-image-selector
$ lerna add react-native-image-selector --scope="@some/package"

Pre Usage

iOS/info.plist

    <key>PHPhotoLibraryPreventAutomaticLimitedAccessAlert</key>
    <false/>
    <key>NSCameraUsageDescription</key>
    <string>카메라 권한을 얻겠습니다.</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>사진을 가져오겠습니다.</string>

PHPhotoLibraryPreventAutomaticLimitedAccessAlert

// you can turn on this to if it is true, the permission alert will not be showed up every time when you request or check photo authorization.

android/AndroidManifest.xml

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />

Usage

import ImageSelector, {
  ImageSelectorOptions,
} from 'react-native-image-selector';

// ...

const options: ImageSelectorOptions = {
  // import Options
  title: '사진 선택',
  cancelButtonTitle: '취소',
  takePhotoButtonTitle: '사진 촬영',
  chooseFromLibraryButtonTitle: '앨범에서 가져오기',
  storageOptions: {
    skipBackup: true,
    path: 'images',
  },
  permissionDenied: {
    title: '권한 설정',
    text: "이 기능을 이용하시려면 권한을 '허용'으로 변경해주세요.",
    reTryTitle: '변경하러가기',
    okTitle: '닫기',
  },
  // iOS Only
  iOSGridNumber: 4,
  // iOS Only, should be upper than iOS 15.0 for 'pageSheet'
  // default value is 'overFullScreen'
  iOSModalPresentationStyle: 'pageSheet',
};

ImageSelector.launchPicker(options, (error, response) => {
  if (error) {
    if (error.code === ImageSelectorErrorType.CAMERA_PERMISSION_DENIED) {
      console.error('camera permission denied');
    }
    return;
  }
  if (response) {
    if (response.didCancel) {
      console.log('USER CANCELED');
      return;
    }
    setResponse(response);
  }
});

Example

$ yarn bootstrap
$ cd example
$ yarn start
$ yarn ios
$ yarn android

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

TODO

  1. remove Documentdirectory photo file (iOS only) when module or react component will be unmounted.
  2. iOS status bar color (Dark Mode).
  3. code refactoring (Android).