react-native-cameraroll
v1.0.0-alpha2
Published
A replacement camera roll module for React Native
Downloads
73
Maintainers
Readme
React Native Camera Roll
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:
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