[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 | [python] 파이썬 공부하는 사이트~ | hooni | 2013.11.12 | 10847 |
1004 | Develop | [python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs) | hooni | 2019.11.22 | 1559 |
1003 | Develop | [python] 애니팡, 캔디팡 매크로 | hooni | 2013.09.06 | 17340 |
1002 | Develop | [python] DJI Tello 드론 코딩 (프로그래밍) 58 | hooni | 2018.03.04 | 25788 |
1001 | PPT | [ppt] 정보보호관리 발표내용 #2 | hooni | 2016.12.08 | 1073 |
1000 | PPT | [ppt] 정보보호관리 발표내용 | hooni | 2016.11.30 | 1084 |
999 | PPT | [ppt] 전자금융보안론 발표/설치 자료 | hooni | 2016.05.03 | 1341 |
998 | PPT | [ppt] 웜프레임워크 발표 양식(국보연) | hooni | 2013.04.23 | 17016 |
997 | PPT | [ppt] 웜 과제 진행사항(프레임워크 검증환경 구축) 보고 | hooni | 2013.04.23 | 15895 |
996 | PPT | [ppt] 시스템보안 연구실 ppt 템플릿.. (CIST) | hooni | 2013.04.23 | 20873 |
995 | PPT | [ppt] 보안경제학 발표자료 | hooni | 2016.11.11 | 5 |
994 | PPT | [ppt] 뚜레쥬르 온라인 마케팅 제안서 | hooni | 2013.04.23 | 23501 |