Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Need help with a crash while saving live photos

$
0
0

I have been stuck with this problem since last week and not able to find any solution online.
I am trying to save live photo using below code.

    PHPhotoLibrary.SharedPhotoLibrary.PerformChanges(() =>
                {
                    PHAssetCreationRequest req = PHAssetCreationRequest.CreationRequestForAsset();
                    req.AddResource(PHAssetResourceType.Photo, NSUrl.FromString(imagePath), null);
                    req.AddResource(PHAssetResourceType.PairedVideo, NSUrl.FromString(VideoPath), null);
                    Console.WriteLine("ok" + req );

                }, (arg1, arg2) =>
                {

                });

This code crashes the app on line PHPhotoLibrary.SharedPhotoLibrary.PerformChanges. I have tried putting try catch block but it never hit the catch block. Is there anything I am missing in the code? Any help will be appreciated.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>