I want to do like, when the app start, app check for iPhone GPS ON or OFF? if GPS off then app quite.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What do you want exactly to know, location service or does user granted access to the location service?
If first, than depending on iOS version you can use:
on iOS pre 4.x:
on iOS 4.x+:
BOOL servicesEnabled = [CLLocationManager locationServicesEnabled];If second, than:
on iOS pre 4.x: there is no quick snippet, you have to wait if didFailWithError or didUpdateToLocation will be called and if second, than user granted access
on iOS 4.x+:
BOOL accessGranted = [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized;And than easily use exit(0) if you option not reached. And yes, try notify user about what you is about to quit the app.