I am writing an iOS application using Xamarin and am having an issue getting videos to save to my photo library. I am using the WriteVideoToSavedPhotosAlbum
method of the ALAssetsLibrary
(code below), but the video is never saved. I do no receive an error, but I also do not receive an asset URL in the completion block either.
Does anyone have any idea what could be going on here?
var url = NSUrl.FromFilename (this.FilePath);
ALAssetsLibrary library = new ALAssetsLibrary ();
library.WriteVideoToSavedPhotosAlbum (url, delegate(NSUrl u, NSError e)
{
if (e != null)
{
new UIAlertView ("Error", "Unable to save video to library", null, "Ok").Show();
}
});
One thing to note is the FilePath
value is a video stored in the applications document directory.
Thanks