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
533 System/OS [java] Tomcat/UTF-8 or All 지원 ㅎㅎ hooni 2013.04.23 16743
532 Develop [java] 거스름돈 계산.. swing 사용 file hooni 2013.04.23 9442
531 Develop [java] 그래픽(도형,다각형..) 이동,확대,축소,회전에 대한 내용.. 1 file hooni 2013.04.23 8636
530 Develop [java] 날짜 계산 (Date, SimpleDateFormat) hooni 2013.04.23 11852
529 Develop [java] 마우스 버튼 테스트.. swing.. file hooni 2013.04.23 7886
528 Develop [java] 메모패드.. 스윙(swing)으로.. file hooni 2013.04.23 8467
527 Develop [java] 스윙(swing) 인터페이스 이용해서 만든 구구단.. ㅋㅋ file hooni 2003.04.23 6682
526 Develop [java] 스윙(swing)버튼 테스트 ㅋㅋ file hooni 2013.04.23 9421
525 Develop [java] 스트러츠(Struts) 세팅 ㅋㅋ file hooni 2013.04.23 42353
524 Develop [java] 에디터.. swing 사용 file hooni 2013.04.23 6298
523 Develop [java] 입출력 스트림 1부 (문자) file hooni 2013.04.23 15293
522 Develop [java] 입출력 스트림 2부 (바이트) file hooni 2013.04.23 10295
521 Develop [java] 입출력 스트림 3부 (오브젝트) hooni 2013.04.23 17136
520 Develop [java] 채팅 프로그램.. swing 사용.. file hooni 2013.04.23 8345
519 Develop [java] 채팅창 처럼.. swing.. file hooni 2013.04.23 8769
518 Develop [java] 채팅창 처럼2.. swing.. file hooni 2013.04.23 6421
Board Pagination Prev 1 ... 39 40 41 42 43 ... 74 Next
/ 74