Hello,
a bug is appeared after iOS 11 upgrade.
"TakeVideoAsync" crash on iOS 11 if "SaveToAlbum" is true
Version Number of Plugin: 3.0.1
Device Tested On: iPhone 7 Plus
Call "TakeVideoAsync" with SaveToAlbum = true on iOS 11
Crash pressing "Use video" after video recording.
file = await CrossMedia.Current.TakeVideoAsync(new StoreVideoOptions
{
Directory = "MyAppName",
Name = DateTime.Now.ToString("hh-mm-dd-MM-yyyy") + ".mp4",
DefaultCamera = CameraDevice.Rear,
SaveToAlbum = true,
Quality = VideoQuality.Medium
});
Thanks for your support
I am not able to reproduce this issue with following permissions enabled
Make sure you have these permission enabled on your app.
Please share the complete crash log, and stacktrace if you continue to have an issue
And are you compiling against iOS11?
@jamesmontemagno @prashantvc both compiling against iOS8 and iOS11
Here the full code that shows that all permissions checks are passed before the TakeVideoAsync invocation:
https://gist.github.com/MarcorOnline/5a569c922125768bbe1ed66b42252add
If I comment the line "SaveToAlbum" all works well.
Info.plist contains the right keys, obviously:
<key>NSPhotoLibraryUsageDescription</key>
<string>Choose video to upload from gallery</string>
<key>NSCameraUsageDescription</key>
<string>Register videos for challenges</string>
<key>NSMicrophoneUsageDescription</key>
<string>Register audio for challenges</string>
I'm using the nuget packages. Next week I will try importing the GitHub files (now I can't do it beacuse I'm out of office). Tell me if you have any ideas.
Thanks for your support!
So, i think they removed some APIs from iOS 11: http://sametdede.com/alassetslibrary-is-deprecated-now-what/
Will need to switch it over to PHPhotoLibrary
@jamesmontemagno @MarcorOnline
iOS 11 added a new permission that is required when you want to add media to the media library.
So adding the following to the Info.plist should fix the issue
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs access to the photo gallery.</string>
@jamesmontemagno the solution provided by @JensSchadron works well!
Thanks!
Will add to docs!
Most helpful comment
Will add to docs!