Allowing location access inside UIWebView

こ雲淡風輕ζ 提交于 2020-01-01 09:30:32

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/26631417/allowing-location-access-inside-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!