这个问题很常见,很明显的bug。国外也有人遇到,并且提出了解决方法。
原因:
the web browser will ask the user for permission to access his/her location.
This don’t automatically happen with a WebView since you have to handle this permission request the Android way in your code.
If your WebView has an associated WebChromeClient when a website attempts to use Geolocation API this will receive a notification via the method
onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback)
where origin is the origin of the web content that requested the permission and callback has the method to call to set the permission state, but no permission is yet set and no UI is displayed to the user.
请官方解决一下。
解决办法,如下:
https://medium.com/@xabaras/android-webview-handling-geolocation-permission-request-cc482f3de210
1 个回复
o***@gmail.com
您好,这个问题您解决了吗? 我也遇到了。
https://medium.com/@xabaras/android-webview-handling-geolocation-permission-request-cc482f3de210
这个链接我打不开,是需要翻墙吗?我梯子刚好坏了。访问不了。
求指点。