Nothing happens on iOS 10.3 on PickPhotoAsync or TakePhotoAsync
See original GitHub issueBug
Version Number of Plugin: 2.6.2 Device Tested On: iPhone SE 10.3 Simulator Tested On: iPhone SE 10.3, iPhone 6 10.3
Expected Behavior
Show image picker or camera
Actual Behavior
Nothing shows… also no exception thrown… Untill I try to do it for the second time… then an Exception is shown (null Exception)
Steps to reproduce the Behavior
Code for TakePhotoAsyn:
var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
Name = System.Guid.NewGuid().ToString("D") + ".jpg",
SaveToAlbum = true,
AllowCropping = true,
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium,
CompressionQuality =70
});
if (file == null)
{
UserDialogs.Instance.Toast(AppResources.dialog_error_save_image);
return;
}
Code for PickPhotoAsync:
var file = await CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
{
CompressionQuality=70,
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium,
});
if (file == null)
return;
else
await Navigation.PushAsync(new SendImagePage(file, selectedContainer));
It works perfectly on Android! I’ve also added the rows to info.plist file:
<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Xamarin.Forms and Plugin.Media: after about 20 photos ...
The problem occurs after taking about 20 photos (depends from the device): ... 10.3.1 and they have enough space to storage photos.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had that problem as well, if I doesn’t call it directly from a buttons “Clicked” event. Try to put your code in Device.BeginInvokeOnMainThread(async () => { //code here }); This is working for me.
Closed as there are multiple work around and already fixed in: Xam.Plugin.Media 2.7.0.50-beta +