From 7f96e2ca0f4082a2e5ca856f1cbe6b804f13b8fe Mon Sep 17 00:00:00 2001 From: Edgar Aroutiounian Date: Wed, 29 Nov 2017 12:07:49 -0800 Subject: [PATCH] Implement deletion of asset-library files Summary: WIP: Starting point insofar as I'm not sure if there should be an Android equivalent. My application needs me to delete photos from the photos in iOS. I have tested this in my application and it works, have a screenshot from iOS asking as well and it does successfully delete the photos from the global Photos app. Related to https://github.com/facebook/react-native/issues/15253, it kind of continues using the deprecated assets-library framework, but that does need (and will be an bigger and bigger issue coming up) of assets-library URLs being used. I also assume RN prefers error handling at the JS level? Are the URLs starting with `asset-library`, etc. Closes https://github.com/facebook/react-native/pull/15481 Differential Revision: D6438016 Pulled By: hramos fbshipit-source-id: 47512140f62f458c14ad2ade2b358846e168c964 --- CameraRoll.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CameraRoll.js b/CameraRoll.js index 596aec7e3b..eccad7d526 100644 --- a/CameraRoll.js +++ b/CameraRoll.js @@ -133,6 +133,10 @@ class CameraRoll { return this.saveToCameraRoll(tag, 'photo'); } + static deletePhotos(photos: Array) { + return RCTCameraRollManager.deletePhotos(photos); + } + /** * Saves the photo or video to the camera roll / gallery. *