From b0c13ebe02074690f992e37d98e03638d9dca0e5 Mon Sep 17 00:00:00 2001 From: Ron Heft Date: Thu, 8 Sep 2016 16:20:51 -0700 Subject: [PATCH] Allow PhotoKit to download photos from iCloud Summary: Resolves #7081 by allowing iCloud to download photos not stored on the device. **Test plan (required)** 1. Verified existing photos stored on the device still display. 2. Deleted my iCloud photo library from my phone and verified the image downloads and displays. Closes https://github.com/facebook/react-native/pull/9530 Differential Revision: D3838470 Pulled By: mkonicek fbshipit-source-id: 810830a4246714b6e166e4411f3fa848b1f1b71c --- Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m b/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m index 5ccc1b1665f82c..d4a0c1a7b4f413 100644 --- a/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m +++ b/Libraries/CameraRoll/RCTPhotoLibraryImageLoader.m @@ -60,6 +60,9 @@ - (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL PHAsset *asset = [results firstObject]; PHImageRequestOptions *imageOptions = [PHImageRequestOptions new]; + // Allow PhotoKit to fetch images from iCloud + imageOptions.networkAccessAllowed = YES; + if (progressHandler) { imageOptions.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info) { static const double multiplier = 1e6;