From 91c52af083a06becd13a91c5828ad2d3baff848a Mon Sep 17 00:00:00 2001 From: Shiva Pandey Date: Fri, 1 Sep 2017 11:29:08 -0700 Subject: [PATCH] Example of getPhotos Method Summary: Example for loading Media using CameraRoll getPhotos method The cameraRoll API doesn't have a proper example of how to use the methods. So, I decided to provide a basic example with a use case. (Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!) Closes https://github.com/facebook/react-native/pull/15647 Differential Revision: D5748965 Pulled By: hramos fbshipit-source-id: df8ad50d597dcc745a7f6abcc52839695ffe452c --- Libraries/CameraRoll/CameraRoll.js | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index e4a22a460..b33e57085 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -217,6 +217,43 @@ class CameraRoll { * - `has_next_page`: {boolean} * - `start_cursor`: {boolean} * - `end_cursor`: {boolean} + * + * Loading images: + * ``` + * _handleButtonPress = () => { + * CameraRoll.getPhotos({ + * first: 20, + * assetType: 'All', + * }) + * .then(r => { + * this.setState({ photos: r.edges }); + * }) + * .catch((err) => { + * //Error Loading Images + * }); + * }; + * render() { + * return ( + * + *