[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),
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
313 | Develop | 프로그래밍 소스 관련 사이트.. | hooni | 2013.04.23 | 16517 |
312 | Develop |
도메인 관련 솔루션 분석할 거.. ㅋㄷ
![]() |
hooni | 2013.04.23 | 7043 |
311 | Develop |
[js] 수명체크 프로그램 ㅋㅋ
![]() |
hooni | 2013.04.23 | 6891 |
310 | Develop |
[c] 패킷 에널라이저 예제 소스(성안당)
![]() |
hooni | 2013.04.23 | 6985 |
309 | Develop | [js] 숫자만 입력하게 하는 자바스크립트 | hooni | 2013.04.23 | 6849 |
308 | Develop |
[js] 셀렉트박스(select)의 옵션(option) 동적으로 추가/제거
![]() |
hooni | 2013.04.23 | 8074 |
307 | Develop |
[c] 학교 건물 최단거리 찾는 웹 연동 프로그램
![]() |
hooni | 2013.04.23 | 6813 |
306 | Develop |
[c] 암호화 알고리즘 DES 구현 ㅋㅋ
![]() |
hooni | 2013.04.23 | 7442 |
305 | Develop |
[c] 내가 만든 암호화 프로그램.. 좋아^^
![]() |
hooni | 2013.04.23 | 7070 |
304 | Develop |
[c] 숫자(int, Number)를 hex코드로 변환하는 소스
![]() |
hooni | 2013.04.23 | 8129 |
303 | Develop |
[c] 문자열 치환해주는 str_replace() 함수
![]() |
hooni | 2013.04.23 | 7409 |
302 | Develop |
[c] GD라이브러리 설치 테스트 소스
![]() |
hooni | 2013.04.23 | 8162 |