[ios] GPS 이용 상태 확인
iOS 설정에서 GPS 설정 확인
[CLLocationManager locationServicesEnabled] == YES
앱에서 GPS 설정 확인
[CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied
이렇게 하면 편리함 ㅋㄷ
/* //결정 전 kCLAuthorizationStatusNotDetermined = 0, //제한 사용 kCLAuthorizationStatusRestricted, //이용 거부 kCLAuthorizationStatusDenied, //항상 이용 (백그라운드에서도; ex.지오펜스) kCLAuthorizationStatusAuthorizedAlways NS_ENUM_AVAILABLE(NA, 8_0), //앱이 사용중일때만 (포그라운드일때만) kCLAuthorizationStatusAuthorizedWhenInUse NS_ENUM_AVAILABLE(NA, 8_0), */ // 사용 예 if([CLLocationManager locationServicesEnabled] == YES && [CLLocationManager authorizationStatus] != kCLAuthorizationStatusDenied) { // show the map } else { // show error }
[원문]
// User has not yet made a choice with regards to this application
kCLAuthorizationStatusNotDetermined = 0,
// This application is not authorized to use location services. Due
// to active restrictions on location services, the user cannot change
// this status, and may not have personally denied authorization
kCLAuthorizationStatusRestricted,
// User has explicitly denied authorization for this application, or
// location services are disabled in Settings.
kCLAuthorizationStatusDenied,
// User has granted authorization to use their location at any time,
// including monitoring for regions, visits, or significant location changes.
kCLAuthorizationStatusAuthorizedAlways NS_ENUM_AVAILABLE(NA, 8_0),
// User has granted authorization to use their location only when your app
// is visible to them (it will be made visible to them if you continue to
// receive location updates while in the background). Authorization to use
// launch APIs has not been granted.
kCLAuthorizationStatusAuthorizedWhenInUse NS_ENUM_AVAILABLE(NA, 8_0),
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
733 | Develop | [c++] mfc로 만든 현재 디렉토리 읽어오기/세팅하기 (GetCurrentDirectory/SetCurrentDirectory) | hooni | 2013.04.23 | 8465 |
732 | Develop | [c++] mfc에서 윈도우 항상 위 속성 주기.. | hooni | 2013.04.23 | 11295 |
731 | Develop | [c++] mfc이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트 | hooni | 2013.04.23 | 9249 |
730 | Develop | [c++] namespace 사용 예 | hooni | 2003.04.23 | 8654 |
729 | Develop | [c++] p.118 확인학습 5번 | hooni | 2003.04.23 | 10734 |
728 | Develop | [c++] p.47 연습문제 3번 | hooni | 2003.04.23 | 10105 |
727 | Develop | [c++] p.58 연습문제 2번 | hooni | 2003.04.23 | 16296 |
726 | Develop | [c++] RSA Sample 4 CPP | hooni | 2013.04.23 | 9181 |
725 | Develop | [c++] SetWindowPos함수를 이용한 크기조절 예제 1 | hooni | 2013.04.23 | 11079 |
724 | Develop | [c++] String Tokenizer (나중에 c 코드로 변경해서 사용할 것) | hooni | 2013.04.23 | 11690 |
723 | Develop | [c++] template 사용예 | hooni | 2003.04.23 | 7147 |
722 | Develop | [c++] Win32 API 기본 출력인 MessageBox() 함수 사용 예제.. | hooni | 2013.04.23 | 12629 |