위치 받아오기 | 날짜, 위치, 건강 데이터 | Appbox iOS SDK 가이드
위치 받아오기
위.경도 위치정보를 받아오기
AppBox.shared.getLocationCurrent(completion:)
Swift
1
AppBox.shared.getLocationCurrent { value, error in
2
guard error == nil else { return }
3
print(value)
4
}
1
[AppBox.shared getLocationCurrentWithCompletion:^(NSDictionary *value, NSError *error) {
2
if (error) { return; }
3
NSLog(@"%@", value);
4
}];
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
completion | 필수 | 결과를 받는 콜백. 메인 스레드에서 한 번 호출됩니다 | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
| 값 | [String: Any]? |
| 오류 | 실패 원인. NSError |
화면 불필요. 화면 없이도 동작합니다. lat, lng를 돌려줍니다. NSLocationWhenInUseUsageDescription이 필요합니다.
웹 브릿지에서는 위치 받아오기의 application.getLocationCurrent입니다.