diff --git a/README.md b/README.md index 95c51f8c7..99b742a7b 100644 --- a/README.md +++ b/README.md @@ -118,16 +118,16 @@ Returns a Promise with photo identifier objects from the local camera roll of th | ------ | ------ | -------- | ------------------------------------------------ | | params | object | Yes | Expects a params with the shape described below. | -* `first` : {number} : The number of photos wanted in reverse order of the photo application (i.e. most recent first for SavedPhotos). +* `first` : {number} : The number of photos wanted in reverse order of the photo application (i.e. most recent first for SavedPhotos). Required. * `after` : {string} : A cursor that matches `page_info { end_cursor }` returned from a previous call to `getPhotos`. * `groupTypes` : {string} : Specifies which group types to filter the results to. Valid values are: * `Album` - * `All` + * `All` // default * `Event` * `Faces` * `Library` * `PhotoStream` - * `SavedPhotos` // default + * `SavedPhotos` * `groupName` : {string} : Specifies filter on group names, like 'Recent Photos' or custom album titles. * `assetType` : {string} : Specifies filter on asset type. Valid values are: * `All` diff --git a/example/js/CameraRollExample.js b/example/js/CameraRollExample.js index 8f1ef9da8..06f28bae1 100644 --- a/example/js/CameraRollExample.js +++ b/example/js/CameraRollExample.js @@ -48,7 +48,7 @@ type State = {| export default class CameraRollExample extends React.Component { state = { - groupTypes: 'SavedPhotos', + groupTypes: 'All', sliderValue: 1, bigImages: true, }; diff --git a/example/js/CameraRollView.js b/example/js/CameraRollView.js index 00ebf014d..a2a14d832 100644 --- a/example/js/CameraRollView.js +++ b/example/js/CameraRollView.js @@ -90,7 +90,7 @@ type Row = { class CameraRollView extends React.Component { static defaultProps = { - groupTypes: 'SavedPhotos', + groupTypes: 'All', batchSize: 5, imagesPerRow: 1, assetType: 'Photos', diff --git a/js/CameraRoll.js b/js/CameraRoll.js index 29f67d649..6e4b2926b 100644 --- a/js/CameraRoll.js +++ b/js/CameraRoll.js @@ -15,12 +15,12 @@ const invariant = require('fbjs/lib/invariant'); const GROUP_TYPES_OPTIONS = { Album: 'Album', - All: 'All', + All: 'All', // default Event: 'Event', Faces: 'Faces', Library: 'Library', PhotoStream: 'PhotoStream', - SavedPhotos: 'SavedPhotos', // default + SavedPhotos: 'SavedPhotos', }; const ASSET_TYPE_OPTIONS = { @@ -37,7 +37,7 @@ export type GroupTypes = $Keys; export type GetPhotosParams = { /** * The number of photos wanted in reverse order of the photo application - * (i.e. most recent first for SavedPhotos). + * (i.e. most recent first). */ first: number, @@ -163,6 +163,9 @@ class CameraRoll { if (!params.assetType) { params.assetType = ASSET_TYPE_OPTIONS.All; } + if (!params.groupTypes) { + params.groupTypes = GROUP_TYPES_OPTIONS.All; + } if (arguments.length > 1) { console.warn( 'CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead', diff --git a/js/__tests__/__snapshots__/CameraRollTest.js.snap b/js/__tests__/__snapshots__/CameraRollTest.js.snap index c4f30ee99..fd40b5949 100644 --- a/js/__tests__/__snapshots__/CameraRollTest.js.snap +++ b/js/__tests__/__snapshots__/CameraRollTest.js.snap @@ -16,6 +16,7 @@ Array [ Object { "assetType": "All", "first": 0, + "groupTypes": "All", }, ], ]