Hello,
Welcome to Microsoft Q&A!
Try to use PHImageManager.RequestImageForAsset to get image data programmatically on iOS.
PHImageRequestOptions options = new PHImageRequestOptions();
options.ResizeMode = PHImageRequestOptionsResizeMode.None;
options.NetworkAccessAllowed = true;
options.DeliveryMode = PHImageRequestOptionsDeliveryMode.HighQualityFormat;
options.Synchronous = true;
PHFetchResult result = PHAsset.FetchAssets(PHAssetMediaType.Image, null);
PHImageManager manager = PHImageManager.DefaultManager;
NSMutableArray images = new NSMutableArray();
foreach(PHAsset asset in result) {
manager.RequestImageForAsset(
asset,
PHImageManager.MaximumSize,
PHImageContentMode.Default,
options,
(image,info) =>
{
images.Add(image);
});
}
Note : the method is fetching the image data from iCloud, so test on a real device .
Refer to
https://stackoverflow.com/questions/12633843/get-all-of-the-pictures-from-an-iphone-photolibrary-in-an-array-using-assetslibr
https://stackoverflow.com/questions/31037859/phimagemanager-requestimageforasset-returns-nil-sometimes-for-icloud-photos
Best Regards,
Cole Xia
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.