Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone SDK: Do I need to ask user for permissions to use GPS?

In my iPhone application I need to use GPS (CoreLocation to be exact) to get current position of the device. I know that most (if not all) applications using GPS have a popup implemented asking the user to allow GPS access. Is that done automatically by the iPhone SDK or should I implement such functionality myself?

I've tried to run my app on iPhone Simulator and it didn't ask for permissions at all so I'm wondering if the same thing will happen on the actual phone.

And if I implement that itself and the SKD provides that out-of-the-box then I'll have two confirmation in my app which I don't want.

like image 605
RaYell Avatar asked Apr 22 '10 11:04

RaYell


2 Answers

This popup is displayed automatically by system if you try to access core location services on device for the first time.
If user denies access then your location delegate will receive didFailWithError: message with kCLErrorDenied error and you must stop using location service then (e.g. call [manager stopUpdatingLocation]; on your location manager).

like image 194
Vladimir Avatar answered Oct 13 '22 14:10

Vladimir


It won't be ask for permission in iphone simulator... It will ask for user permission in iphone device only... and for that you do not need to do anything explicitly.. It will ask implicitly...

like image 28
Mihir Mehta Avatar answered Oct 13 '22 12:10

Mihir Mehta