[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),
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
1017 | Develop | [html] 캐쉬된 웹페이지 사용하지 않도록 하는 방법 | hooni | 2003.04.23 | 13072 |
1016 | Develop | [js] 키보드 아스키코드(ASCII) 코드보기 | hooni | 2003.04.23 | 32511 |
1015 | Develop | [js] 이벤트 핸들러(Event Handlers) | hooni | 2003.04.23 | 6758 |
1014 | Develop | [js] 사라지는 브라우저 | hooni | 2003.04.23 | 6879 |
1013 | Develop | [c] OpenGL 마우스 이벤트 | hooni | 2003.04.23 | 8756 |
1012 | Develop | [js] 점점 커지는 새창.. | hooni | 2003.04.23 | 7024 |
1011 | Develop |
[c][java] 소켓 프로그래밍(채팅 서버 C, 클라이언트 Java)
![]() |
hooni | 2003.04.23 | 7032 |
1010 | Develop | [c] 신기한 atoi함수(www.game79.net) | hooni | 2003.04.23 | 7292 |
1009 | Develop | [c] OpenGL 색 입방체의 회전(입체) | hooni | 2003.04.23 | 7898 |
1008 | Develop |
[php] 마시마로 캐릭터 방명록
![]() |
hooni | 2003.04.23 | 8275 |
1007 | Develop |
[c] 시간 계산 하는 프로그램 소스코드
![]() |
hooni | 2003.04.23 | 6776 |
1006 | Develop | [linux] 프로세스 관련 시스템콜 | hooni | 2003.04.23 | 7876 |