0

Reported bug for my app : When "Optimise iphone storage" feature is ON in iPhone, all photos are not accessible within my app, only full resolution ones are accesible.

How can I test this as "Optimise iphone storage" works only when iPhone is low on space?

My query: 1). Is there a way to force(for debugging pourpose) "Optimise iphone storage" feature do the actual optimization work.(As it works only when iPhone is low on space).

Note: Facebook app is able to access all photos.

Any pointers will be really appreciated.

O Fenômeno
  • 445
  • 3
  • 14

1 Answers1

0

Let me first point out that you probably working with the PhotosFramework and not with ALAssetsLibrary, since iCloud photo's aren't supported in the ALAssetLibrary (it is also deprecated as of iOS 9.0)

It sounds as though the PHImageRequestOptions has networkAccessAllowed set to false. For photo's that are stored in the cloud it should go to the network to download them, if you don't have it turned on it will just return a nil asset for assets that are in the cloud.

PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
options.networkAccessAllowed = YES;

[[PHImageManager defaultManager] requestImageForAsset:asset targetSize:targetSize contentMode:PHImageContentModeAspectFill options:options resultHandler:^(UIImage *result, NSDictionary *info) {

}];

There is also a bug where the image request sometimes returns a nil asset. But since you said it happens with all photo's it seems as something else than this bug: https://forums.developer.apple.com/thread/16244

Marijn
  • 1,439
  • 12
  • 12