Open muhaym opened 6 years ago
I am facing the same issue Unhandled managed exception: Objective-C exception thrown. Name: NSGenericException Reason: UIPopoverPresentationController (<UIPopoverPresentationController: 0x11bbc9ea0>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.
Since I am busy, till I work on next update, any one can take and fix the logic to support Ipads
@muhaym Thanks for the update. It's better than ignoring the issues as some developers do. There are so much potential and features that you can also add such as changing map type ,pick multiple places ,...
I don't have a lot of experience in swift or Objective C but if the code is clean and well documented, I might be able to somehow add those options if not already there.
This is pure C#, have a look at https://github.com/muhaym/CrossPlacePicker/blob/master/src/CrossPlacePicker/Plugin.CrossPlacePicker.iOS/CrossPlacePickerImplementation.cs
This might be a simple fix.
Regarding other features, if it's available in Google Place Picker for iOS and Android, I am happy to implement it, but I don't think Google Place Picker supports it. This is just wrapper over native Place Pickers provided by google, and I just made it dead simple to use it
@muhaym is there a way for now just to handle the crashing? The code is surrounded with try and catch but the error occurs in the native code.
This is the place you have to add the fix, making it support Tablet.
A reference is here, but need to make sure it's backwards compatible and don't break anything.
@muhaym , what kind of technique did you use to covert the code from Swift or Objective C to C#? Can you please just refer me to a resource or method name so I can learn it myself?
if anyone is facing this issue , you can handle the tablet size and show a message instead of the crash.
if (Device.Idiom == TargetIdiom.Tablet) { await _pageDialogService.DisplayAlertAsync("Alert", "Taking picture is not supported in tablets, please use the remarks to describe the location.", "OK"); return; }
I learned a little about how to create plugins. Xamarin has access to native SDK and you can add specific code in each platform. You can also call other libraries and use them. It's like creating a custom renderer or dependency service.
I might work on a fix later but I am sure that the developer that I am very thankful for is the most expert to solve it in his coming update.
+1
wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr