Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowing location access inside UIWebView

I have a webview based application and when I access http://maps.google.com, my webview is not passing the location as Safari does. I know CLLocationManager is needed, but do I get a callback when a webpage (maps.google.com) wants access to my device location? How do I respond back with the coordinates to the webpage from my WebView?

like image 766
Aster Veigas Avatar asked Oct 29 '14 13:10

Aster Veigas


1 Answers

The webview will start monitoring the location automatically, however since iOS 8 location access requires the NSLocationWhenInUseUsageDescription description in your info plist to be set.

If this has been done, it will prompt the user automatically to allow location access.

like image 152
Tim Bodeit Avatar answered Oct 28 '22 23:10

Tim Bodeit