Develop
2015.04.27 18:40

[ios] GPS 이용 상태 확인

조회 수 2925 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

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
번호 분류 제목 글쓴이 날짜 조회 수
905 Database [mysql] MacOS에 MySQL 설치, 설정, 암호 재설정 file hooni 2017.12.15 3800
904 Database [mysql] error while loading shared libraries: libmysqlclient.so.10: hooni 2003.04.23 15288
903 Database [mysql] ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. hooni 2017.12.15 5716
902 Database [mysql] DB->Text, Text->DB 변환 hooni 2003.04.23 13411
901 Database [mysql] CPU 점유율이 높을 때 확인할 내용 hooni 2015.08.26 8899
900 System/OS [ms-sql] 프로시져 예제.. file hooni 2013.04.23 14277
899 System/OS [ms-sql] 서브스트링(substring), 프로시저(SP) 작성 예제 hooni 2013.04.23 42433
898 Develop [maven] Mac OS에 메이븐(maven) 설치하기 file hooni 2015.01.21 2088
897 Develop [matlab] 정보은닉 스테가노그래피(Steganography) 수업 file hooni 2016.10.03 2712
896 Develop [matlab] ZigZag-Scanning (2-D Array) file hooni 2016.10.15 4760
895 System/OS [mac][추천 무료앱] 구름 입력기 - 국내 맥 사용자를 위한 한글 대안 입력기 1 file hooni 2015.01.04 4414
894 System/OS [mac] 패키지 매니저, MacPort hooni 2015.01.03 2137
893 System/OS [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리 hooni 2013.07.10 20360
892 System/OS [mac] 맥에서 슬립(잠자기) 모드 진입을 막는 방법~ hooni 2013.10.10 35281
891 System/OS [mac] 맥에서 기본 실행 앱 변경하기 file hooni 2018.03.02 3890
890 System/OS [mac] 맥에서 APM(apache,php,mysql) 구성하기 hooni 2013.04.23 42392
Board Pagination Prev 1 ... 16 17 18 19 20 ... 74 Next
/ 74