[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),
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1005 | Develop | [opengl] 컴퓨터 그래픽스 강의 자료(수업자료) | hooni | 2003.04.23 | 20432 |
1004 | Develop | [android] [번역] 안드로이드 Android Cloud to Device Messaging(C2DM) | hooni | 2013.04.23 | 20423 |
1003 | Develop | [php] substr() 한글 자를 때 깨짐 방지 | hooni | 2014.01.09 | 20365 |
1002 | System/OS | [linux] 꿀통(honeyd) 설치하기.. 메뉴얼 과정 6 | hooni | 2006.04.23 | 20219 |
1001 | Develop | [ios] UIView에서 상위 UIViewController 가져오기 | hooni | 2013.09.27 | 20159 |
1000 | Develop | [c] UTF-8을 EUC-KR로 변환.. (iconv) | hooni | 2013.04.23 | 20135 |
999 | Develop | [c] AES 알고리즘 (암호화/복호화) | hooni | 2003.04.23 | 20047 |
998 | System/OS | [windows] 여러가지 활용 팁 | hooni | 2003.04.23 | 19975 |
997 | Etc | 양성/음성 오류에 대한 개념 | hooni | 2013.04.23 | 19853 |
996 | Etc | [web] 제로보드 XE 템플릿에서 if문에 대해서 알아봅시다 | hooni | 2013.08.16 | 19812 |
995 | Etc | [세미나] XML 레포트.. | hooni | 2003.04.23 | 19702 |
994 | Develop | [php] XE 에서 php 구문 사용하기 (XE 템플릿에서) | hooni | 2013.10.31 | 19445 |