我必须在a中检索用户的位置WebView.我使用以下Javascript执行此操作:
function getLocation() {
navigator.geolocation.getCurrentPosition(displayLocation, handleError);
}
Run Code Online (Sandbox Code Playgroud)
但是权限请求弹出窗口永远不会打开.
我设置了这些设置:
ws.setJavaScriptEnabled(true);
ws.setGeolocationEnabled(true);
ws.setJavaScriptCanOpenWindowsAutomatically(true);
Run Code Online (Sandbox Code Playgroud)
从一个位置访问用户位置的正确方法是WebView什么?