我必须在 WebView
中检索用户的位置:
function getLocation() {
navigator.geolocation.getCurrentPosition(displayLocation, handleError);
}
但是许可请求弹出窗口永远不会打开。
我设置了这些设置:
ws.setJavaScriptEnabled(true);
ws.setGeolocationEnabled(true);
ws.setJavaScriptCanOpenWindowsAutomatically(true);
从 WebView
中访问用户位置的正确方法是什么?