ios - Loading image from "My Photo Stream" using UIImagePicker results URL and PHAsset on iOS8 -


I'm updating an app for ios8 from iOS7 and struggling to work with UIImagePicker to load images from "My Photo Stream".

Category UIImagePicker implementation of photo extend standard and I retrieve the URL of selected photos:

< Pre> NSURL * url = [information object: @ "UIImagePickerControllerReferenceURL"];

I will use the new IOS8 API to load the image does have:

  PHFetchResult * result = [PHAsset fetchAssetsWithALAssetURLs: @ [url] Option: zero];  

This fails to work results. Coat is zero and no image is found. The URL has a different UUID if I select the photo from "Moment" or "Camera Roll" but it is well prepared. (Phones running 8.1):

url NSURL * @ "asset library: //asset/asset.JPG? Id = 4522DBD1-862C-42BE-AF7C-0D6C76CA7590 and ext = JPG"

Is there any code for any person to upload photos from "My Photo Stream" or is there a way to disable it for UIMJPC display?

By using the old Elassette Library property. ARRR also fails to load these images.

I think you can try to get the "My Photo Stream" album.

  PHFetchResult * smartAlbums = [PHAssetCollection fetchAssetCollectionsWithType: PHAssetCollectionTypeAlbum subtypes: PHAssetCollectionSubtypeAlbumMyPhotoStream options: zero];  

My Photo Stream are uploaded photos iCloud album and iCloud to manage them efficiently, the photos were captured within 30 days, and I think PHAsset or ALAssetLibrary is Has been presented with locally stored assets. Here's a test I did on my device, I used an image picture to get a photo URL from the stream image, which

  "property-library: // asset /asset.JPG? Id = 60AE4E50-B835-47EB-B896-5974C21F8C9B & ext = JPG ";  

By using PHAsset on the picture I get the local identifier:

  "60AE4E50-B835-47EB-B896-5974C21F8C9B / L0 / 001 " 

So I think that you can strip the ID from the URL, and find out which asset's local identifier is included, then you want to get the PHAsset.


Comments