HybridWebView and Location Services - duplicate permission prompts. How to suppress Safari's prompt?

RyanDohertyRyanDoherty USMember ✭✭

I am using Xamarin.Forms and the HybridWebView as described here:
https://developer.xamarin.com/samples/xamarin-forms/CustomRenderers/HybridWebView/

I have a JavaScript function which uses the HTML5 geolocation feature and it triggers two permissions prompts. One for the app and one for the local webpage. When I select OK for the app permission, it keeps that in the privacy settings but the browser prompt continues to show. Is there a way to hide or eliminate the browser prompt if the app permissions have already been responded to? The expected behavior is that the browser permissions would inherit the App permissions. Is there a way to configure it so that it will?

A couple notes and followup questions:

  • I have added both NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription to the Info.plist
  • Even if I select Always or "While Using the App" in the app's location services settings, the browser permission box still triggers.
  • If possible, I'd like a cross-platform solution, but an iOS one is a higher priority. If there is a xplat solution, I'd be very grateful.
  • If there is no way to suppress the browser prompt, how can I update the HybridWebView with the user's current location using the HybridWebViewRenderer?

Answers

Sign In or Register to comment.