How to ask permission from user for second time to allow to access the current location?

自古美人都是妖i 提交于 2019-12-04 10:36:36

I think you can turn on Location Services from device Settings -> Location Services tab.. See the image below

Update: When location services is off for an app, the location manager will fire error with error code kCLErrorDenied then you can show an alert to user to Turn On location services from settings..

Or, you can use the following code too

if (![CLLocationManager locationServicesEnabled])

Is this just me or what? There are several questions like this. Each of which are answered by what the user should do to reenable the location service instead of what the the programmer should do to get that precious consistent alert.

call

[singleton.locationManager startUpdatingLocation];

That's actually what pops the alert.

If you don't call it, then the alert doesn't show up.

If you check first if it's enabled and then call it only if it's enabled, then the alert doesn't show up.

I spent weeks figuring this out. There is no info whatsoever about this in internet.

I think Yes. Deleting the app and download another one is the only solution as that alert message asking user's permission to access location settings is not getting fired by the app but by iPhone OS and hence in my opinion you can't ask it programatically.

This need to be done by users.

in ios 7: Settings->General->Restriction->turn on if not->Under privacy -Location services

Rishi

You can reset location manually in your device Setting-->Privacy-->Location, then restart your app again.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!