AssetUri is not available with PHPhotoLibrary .
We can use request.PlaceholderForCreatedAsset.LocalIdentifier
instead.
UIImagePickerController controller = new UIImagePickerController {
SourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum,
ImagePickerControllerDelegate = new PickerDelegate(),
MediaTypes = new string[] { UTType.Image }
};
this.PresentViewController(controller, true, null);
public class PickerDelegate: UIImagePickerControllerDelegate
{
public override void FinishedPickingImage(UIImagePickerController picker, UIImage image, NSDictionary editingInfo)
{
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges(
() => {
PHAssetChangeRequest request = PHAssetChangeRequest.FromImage(image);
string id = request.PlaceholderForCreatedAsset.LocalIdentifier;
},
(bool success, NSError error) => {
}
);
}
}
Refer to
How to get the URL of an image just added in PHPhotoLibrary
Get URL of a newly created asset, iOS 9 style