I have an image picker in my app that opens up the users photo album (iOS) so they can select an image. I am using xamarin cross platform so I have a dependency service leading to this chunk of code. I got all the correct code after that but the issue is that the image picker doesn't display the first one or two times and only starts working after the user refreshes the entire app. Here is the following code that I am using to create the picker:
imagePicker = new UIImagePickerController ();
imagePicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
imagePicker.MediaTypes = UIImagePickerController.AvailableMediaTypes (UIImagePickerControllerSourceType.PhotoLibrary);
imagePicker.FinishedPickingMedia += Handle_FinishedPickingMedia;
imagePicker.Canceled += Handle_Canceled;
//Show the picker
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentModalViewController (imagePicker, true);
Note that I have tried NavigationController.PresentModalViewController but just end up with a null error. I also tried just "PresentViewController" but no help there. Also, is there any different way to display the image picker? Any help would be greatly appreciated!