GithubHelp home page GithubHelp logo

chrisbianca / react-native-cameraroll Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 7.0 20 KB

A replacement camera roll module for React Native

License: MIT License

Java 58.25% Objective-C 30.01% Ruby 5.39% JavaScript 6.35%

react-native-cameraroll's Introduction

React Native Camera Roll

npm version License

RNCameraRoll is a replacement CameraRoll module for React Native that offers consistent behaviour across iOS and Android


Install

npm i react-native-cameraroll --save

Platform specific setup guides:

ios android


Usage

import RNCameraRoll from 'react-native-cameraroll';

getAssets(params: Object): Promise<Object>

Retrieve image and/or video assets from the device's Camera Roll.

RNCameraRoll.getAssets({ assetType: 'image', limit: 20 })
  .then(response => console.log(response))
  .catch(err => console.error(err));

params takes the following shape:

{
  assetType: 'image' | 'video' | 'all';
  limit: number; // How many assets to return
  start?: string | number; // The start cursor (use end_cursor from previous request)
}

The response takes the following shape:

{
  assets: [{
    filename: string;
    height: number;
    location: {
      altitude?: number;
      heading?: number;
      latitude: number;
      longitude: number;
      speed?: number;
    };
    timestamp: number;
    type: 'image' | 'video';
    uri: string;
    width: number;
  }],
  page_info: {
    end_cursor: string | number;
    has_next_page: boolean;
    start_cursor: string | number;
  };
}

Contributing

We welcome any contribution to the repository. Please ensure your changes to the JavaScript code follow the styling guides controlled by ESlint. Changes to native code should be kept clean and follow the standard of existing code.


License

  • MIT

react-native-cameraroll's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-native-cameraroll's Issues

NPM package

Hi @chrisbianca , per the react-native-community guidelines, I'm moving the npm package named @react-native-community/cameraroll to a new npm package (https://github.com/react-native-community/discussions-and-proposals/blob/master/partners/0002-apply-organization-repository-policy.md). To cause the least amount of confusion, I want to ask you if we can use the react-native-cameraroll package, which you currently hold. Your package there looks like it hasn't been updated recently, perhaps you wouldn't mind helping out the community find the more canonical package by allowing the https://github.com/react-native-cameraroll/react-native-cameraroll library use this namespace?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.