https://docs.expo.dev/versions/latest/sdk/location
Location
Expo is an open-source platform for making universal native apps for Android, iOS, and the web with JavaScript and React.
docs.expo.dev
#expo-location 설치
> npx expo install expo-location
Method
1. 디바이스 권한요청 (필수)
- requestBackgroundPermissionsAsync() : 백그라운드 권한요청
- requestForegroundPermissionsAsync() : 포그라운드 권한요청
- getLastKnownPositionAsync(options) : 유저의 마지막 위치 get
- getCurrentPositionAsync(options) : 현재 위치 get
- watchPositionAsync(options, callback) : 위치 관찰(이동 추적)
- geocodeAsync(address, options) : 주소를 위도, 경도로 변환
- reverseGeocodeAsync(location, options) : 위도,경도를 입력하면 주소를 반환
- startGeofencingAsync(taskName, regions) : 유저가 특정 지역을 벗어났을 때 알림
'FrontEnd > React Native' 카테고리의 다른 글
[react native] 텍스트 입력 textInput (0) | 2023.02.25 |
---|---|
[react native] 터치 이벤트 컴포넌트 (0) | 2023.02.25 |
[react native] 화면 스크롤 하기 (0) | 2023.02.24 |
[react native] 화면 크기 가져오기 (0) | 2023.02.24 |
[react native] 프로젝트 생성 (expo) (0) | 2023.02.24 |