yarn add @react-native-community/geolocation --save 或 npm install @react-native-community/geolocation --save
import geolocation from "@react-native-community/geolocation"
// 然后使用
navigator.geolocation = geolocation;
navigator.geolocation.getCurrentPosition((pos) => {
let coords = pos.coords;
// 打印经度-维度
alert(coords.longitude + "," + coords.latitude);
})