public override void DidFinishCapture(AVCapturePhotoOutput captureOutput, AVCaptureResolvedPhotoSettings resolvedSettings, NSError error) { if (ShouldSaveCaptureResult(error)) { PHAssetManager.PerformChangesWithAuthorization(TryToAddPhotoToLibrary, null, DidFinish); } }
private void CleanUp(bool saveToAssets, NSUrl outputFileUrl) { if (_backgroundRecordingId != null) { if (_backgroundRecordingId != UIApplication.BackgroundTaskInvalid) { UIApplication.SharedApplication.EndBackgroundTask(_backgroundRecordingId.Value); } _backgroundRecordingId = UIApplication.BackgroundTaskInvalid; } if (!saveToAssets) { DeleteFileIfNeeded(outputFileUrl); return; } PHAssetManager.PerformChangesWithAuthorization(() => SaveVideoToLibrary(outputFileUrl), () => DeleteFileIfNeeded(outputFileUrl), null); }