From aa47532fdb086cd00daadf3e02627a3f9ef1fb52 Mon Sep 17 00:00:00 2001 From: Bartol Karuza Date: Thu, 21 May 2020 10:52:27 +0300 Subject: [PATCH] fix: deprecate saveToCameraRoll (#183) fixes #182 --- README.md | 12 +++--------- js/CameraRoll.js | 3 +++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b082e5d..3ac184a 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,6 @@ On Android permission is required to read the external storage. Add below line t ### Methods -* [`saveToCameraRoll`](#savetocameraroll) * [`save`](#save) * [`getAlbums`](#getalbums) * [`getPhotos`](#getphotos) @@ -87,18 +86,10 @@ On Android permission is required to read the external storage. Add below line t ### `save()` -Saves the photo or video of a particular type to an album. This function works the same as `saveToCameraRoll`, but it allows to specify a particular album you want to store the asset to. - ```javascript CameraRoll.save(tag, { type, album }) ``` -### `saveToCameraRoll()` - -```javascript -CameraRoll.saveToCameraRoll(tag, [type]); -``` - Saves the photo or video to the photo library. On Android, the tag must be a local image or video URI, such as `"file:///sdcard/img.png"`. @@ -107,6 +98,8 @@ On iOS, the tag can be any image URI (including local, remote asset-library and If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise it will be treated as a photo. To override the automatic choice, you can pass an optional `type` parameter that must be one of 'photo' or 'video'. +It allows to specify a particular album you want to store the asset to. + Returns a Promise which will resolve with the new URI. **Parameters:** @@ -115,6 +108,7 @@ Returns a Promise which will resolve with the new URI. | ---- | ---------------------- | -------- | ---------------------------------------------------------- | | tag | string | Yes | See above. | | type | enum('photo', 'video') | No | Overrides automatic detection based on the file extension. | +| album | string | No | The album to save to | --- ### `getAlbums()` diff --git a/js/CameraRoll.js b/js/CameraRoll.js index 62c1238..df04cb2 100644 --- a/js/CameraRoll.js +++ b/js/CameraRoll.js @@ -176,6 +176,9 @@ class CameraRoll { tag: string, type?: 'photo' | 'video' | 'auto', ): Promise { + console.warn( + 'CameraRoll.saveToCameraRoll(tag, type) is deprecated. Use the save function instead', + ); return CameraRoll.save(tag, {type}); } static getAlbums(