Develop
2015.04.27 18:40

[ios] GPS 이용 상태 확인

Views 1293 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

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),


?

List of Articles
No. Category Subject Author Date Views
901 Develop [c] 그래픽스 자료(OpenGL 라이브러리) 샘플 소스 file hooni 2003.04.23 10181
900 Develop [c] 근의 공식으로 2차방정식 풀기.. file hooni 2003.04.23 7764
899 Develop [c] 기막힌 정렬 코드 ㅋㄷ file hooni 2015.10.13 807
898 Develop [c] 기본 자료형(int)이 표현할 수 없는 큰 수(Big number)를 덧셈하는 코드. 1 hooni 2013.04.23 13448
897 Develop [c] 날짜로 요일 찾기.. hooni 2003.04.23 8482
896 Develop [c] 내가 만든 암호화 프로그램.. 좋아^^ file hooni 2013.04.23 7021
895 Develop [c] 네트워크 관련 프로그래밍 (포트스캔 탐지 샘플) file hooni 2013.04.23 7198
894 Develop [c] 네트워크 보안 프로그래밍 과제 (Server,Agent,Client) file hooni 2013.04.23 6472
893 Develop [c] 네트워크 정보 알아보기 file hooni 2013.04.23 16122
892 Develop [c] 네트워크 트래릭 모니터링.. 졸업작품.. 2 file hooni 2013.04.23 11047
891 Develop [c] 농구팀 점수 산출 프로그램 소스 file hooni 2003.04.23 7372
890 Develop [c] 다중연결 서버 만들기 #1 - fork() 사용 file hooni 2013.04.23 12918
889 Develop [c] 다중연결 서버 만들기 #2 - select() 사용 file hooni 2013.04.23 9361
888 Develop [c] 다중연결 서버 만들기 #3 - poll() 사용 file hooni 2013.04.23 6340
887 Develop [c] 다중연결 서버 만들기 #4 - thread 사용 file hooni 2013.04.23 23702
886 Develop [c] 단기과정[01/06] sizeof, 실수표현, 메모리, 연산자 hooni 2003.04.23 6927
Board Pagination Prev 1 ... 16 17 18 19 20 ... 74 Next
/ 74