Geolocation.getCurrentPosition
을 iOS
환경에서 실행하니 오랜 시간(평균 10초 이상)이 걸림
반면, Android
는 문제없이 빠르게 위치를 반환했음
if(Platform.OS === 'ios') {
return new Promise((resolve, reject) => {
const id = Geolocation.watchPosition((pos) => {
Geolocation.clearWatch(id);
resolve(pos);
}, (err) => {
if(err) {
reject(err);
}
}, {enableHighAccuracy: true});
}
iOS
는 따로 분기처리하여 getCurrentPosition
을 사용하지 않고, watchPosition
을 사용하니 훨씬 빠르고 비슷한 정확도의 위치가 반환되었음