From 9ee815f6b52e0c2417c04e5a05e1e31df26daed2 Mon Sep 17 00:00:00 2001 From: Muhammad Raihan Muhaimin Date: Sat, 17 Sep 2016 20:29:27 -0700 Subject: [PATCH] Added name of the file with camera roll pictures Summary: Added name parameter when delivering the camera roll images using react native CameraRoll library. Based on http://stackoverflow.com/questions/37283976/react-native-get-photo-name-from-camera-roll-ios Closes https://github.com/facebook/react-native/pull/9961 Differential Revision: D3883582 Pulled By: majak fbshipit-source-id: 5bfd1eb0601b3ce2ef1cdb4485060661d2fbad32 --- Libraries/CameraRoll/RCTCameraRollManager.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/CameraRoll/RCTCameraRollManager.m b/Libraries/CameraRoll/RCTCameraRollManager.m index 1e0b5c23e..e02e447d6 100644 --- a/Libraries/CameraRoll/RCTCameraRollManager.m +++ b/Libraries/CameraRoll/RCTCameraRollManager.m @@ -185,12 +185,14 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params CGSize dimensions = [result defaultRepresentation].dimensions; CLLocation *loc = [result valueForProperty:ALAssetPropertyLocation]; NSDate *date = [result valueForProperty:ALAssetPropertyDate]; + NSString *filename = [result defaultRepresentation].filename; [assets addObject:@{ @"node": @{ @"type": [result valueForProperty:ALAssetPropertyType], @"group_name": [group valueForProperty:ALAssetsGroupPropertyName], @"image": @{ @"uri": uri, + @"filename" : filename, @"height": @(dimensions.height), @"width": @(dimensions.width), @"isStored": @YES,