diff --git a/js/CameraRoll.js b/js/CameraRoll.js index 9f5c8ea12..29f67d649 100644 --- a/js/CameraRoll.js +++ b/js/CameraRoll.js @@ -10,6 +10,7 @@ 'use strict'; import RNCCameraRoll from './nativeInterface'; + const invariant = require('fbjs/lib/invariant'); const GROUP_TYPES_OPTIONS = { @@ -159,6 +160,9 @@ class CameraRoll { * See https://facebook.github.io/react-native/docs/cameraroll.html#getphotos */ static getPhotos(params: GetPhotosParams): Promise { + if (!params.assetType) { + params.assetType = ASSET_TYPE_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 c2840613f..c4f30ee99 100644 --- a/js/__tests__/__snapshots__/CameraRollTest.js.snap +++ b/js/__tests__/__snapshots__/CameraRollTest.js.snap @@ -14,6 +14,7 @@ exports[`CameraRoll Should call getPhotos 1`] = ` Array [ Array [ Object { + "assetType": "All", "first": 0, }, ], diff --git a/typings/CameraRoll.d.ts b/typings/CameraRoll.d.ts index 66c08da5c..c2e417f04 100644 --- a/typings/CameraRoll.d.ts +++ b/typings/CameraRoll.d.ts @@ -29,7 +29,7 @@ export interface GetPhotosParams { groupName?: string, assetType?: AssetType mimeTypes?: Array, -}; +} export interface PhotoIdentifier { node: {